[-] Core: Fix Tools::file_get_contents for post and curl
This commit is contained in:
@@ -1289,6 +1289,16 @@ class ToolsCore
|
|||||||
curl_setopt($curl, CURLOPT_URL, $url);
|
curl_setopt($curl, CURLOPT_URL, $url);
|
||||||
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $curl_timeout);
|
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $curl_timeout);
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
|
curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
|
||||||
|
$opts = stream_context_get_options($stream_context);
|
||||||
|
if (isset($opts['http']['method']) && Tools::strtolower($opts['http']['method']) == 'post')
|
||||||
|
{
|
||||||
|
curl_setopt($curl, CURLOPT_POST, true);
|
||||||
|
if (isset($opts['http']['content']))
|
||||||
|
{
|
||||||
|
parse_str($opts['http']['content'], $datas);
|
||||||
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $datas);
|
||||||
|
}
|
||||||
|
}
|
||||||
$content = curl_exec($curl);
|
$content = curl_exec($curl);
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
return $content;
|
return $content;
|
||||||
|
|||||||
Reference in New Issue
Block a user