Bugfix: The timeout value of z_fetch_url couldn't be set manually

2022.09-rc
Michael Vogel 2015-11-03 00:48:49 +01:00
rodzic 939de1ec7d
commit 6a15dded0e
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -86,10 +86,9 @@ function z_fetch_url($url,$binary = false, &$redirects = 0, $opts=array()) {
if(x($opts,'nobody')){ if(x($opts,'nobody')){
@curl_setopt($ch, CURLOPT_NOBODY, $opts['nobody']); @curl_setopt($ch, CURLOPT_NOBODY, $opts['nobody']);
} }
if(intval($timeout)) { if(x($opts,'timeout')){
@curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); @curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
} } else {
else {
$curl_time = intval(get_config('system','curl_timeout')); $curl_time = intval(get_config('system','curl_timeout'));
@curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60)); @curl_setopt($ch, CURLOPT_TIMEOUT, (($curl_time !== false) ? $curl_time : 60));
} }