Commit 3c7677d5 authored by ejn's avatar ejn Committed by Edward Nash

Check ini_get is not disabled before using it

As described in #492, ini_get may often be disabled in production environments, causing warnings to be generated (and NULL) to be returned. This change checks that ini_get is usable (otherwise function_exists will return FALSE) before using it, preventing the warnings while introducing no functional change.
parent aa463671
...@@ -116,7 +116,7 @@ class Curl extends Configurable implements AdapterInterface ...@@ -116,7 +116,7 @@ class Curl extends Configurable implements AdapterInterface
$handler = curl_init(); $handler = curl_init();
curl_setopt($handler, CURLOPT_URL, $uri); curl_setopt($handler, CURLOPT_URL, $uri);
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true); curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
if (!ini_get('open_basedir')) { if (!(function_exists('ini_get') && ini_get('open_basedir'))) {
curl_setopt($handler, CURLOPT_FOLLOWLOCATION, true); curl_setopt($handler, CURLOPT_FOLLOWLOCATION, true);
} }
curl_setopt($handler, CURLOPT_TIMEOUT, $options['timeout']); curl_setopt($handler, CURLOPT_TIMEOUT, $options['timeout']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment