This commit is contained in:
gRoussac
2013-06-18 11:31:29 +02:00
parent aea53e034a
commit 6519d3682a
+9 -7
View File
@@ -1303,14 +1303,16 @@ class ToolsCore
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$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']))
if ($stream_context != null) {
$opts = stream_context_get_options($stream_context);
if (isset($opts['http']['method']) && Tools::strtolower($opts['http']['method']) == 'post')
{
parse_str($opts['http']['content'], $datas);
curl_setopt($curl, CURLOPT_POSTFIELDS, $datas);
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);