Просмотр исходного кода

#4985 cURL isn't setting cookies correctly in bx_file_get_contents function

Alex Trofimov 1 год назад
Родитель
Сommit
76f32416e1
1 измененных файлов с 1 добавлено и 11 удалено
  1. 1 11
      inc/utils.inc.php

+ 1 - 11
inc/utils.inc.php

@@ -1132,17 +1132,7 @@ function bx_file_get_contents($sFileUrl, $aParams = array(), $sMethod = 'get', $
             curl_setopt($rConnect, CURLOPT_HTTPHEADER, $aHeaders);
 
         if (defined('BX_DOL_URL_ROOT') && 0 === strpos($sFileUrl, BX_DOL_URL_ROOT)) {
-            $sAllCookies = '';
-            foreach($_COOKIE as $sKey => $mValue){
-                if(is_array($mValue)){
-                    foreach ($mValue as $k => $v)
-                        $sAllCookies .= "{$sKey}[{$k}]={$v};";
-                }
-                else{
-                    $sAllCookies .= $sKey . '=' . $mValue . ';';
-                }
-            }
-            curl_setopt($rConnect, CURLOPT_COOKIE, $sAllCookies);
+            curl_setopt($rConnect, CURLOPT_COOKIE, http_build_query($_COOKIE, '', '; ', PHP_QUERY_RFC3986));
         }
 
         if ($aCustomCurlParams)