Update false evaluations

=== false and !== false to is_null where appropriate.
This commit is contained in:
Adam Magness 2017-12-06 14:57:06 -05:00
parent 09d798ba77
commit cadfef63c4
7 changed files with 13 additions and 9 deletions

View file

@ -126,6 +126,7 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array())
if (x($opts, 'timeout')) {
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} else {
// if Config::get returns null, intval will be 0 which will also evaluate to false
$curl_time = intval(Config::get('system', 'curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}
@ -302,6 +303,7 @@ function post_url($url, $params, $headers = null, &$redirects = 0, $timeout = 0)
if (intval($timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
} else {
// if Config::get returns null, intval will be 0 which will also evaluate to false
$curl_time = intval(Config::get('system', 'curl_timeout'));
curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
}