]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: The timeout value of z_fetch_url couldn't be set manually
authorMichael Vogel <icarus@dabo.de>
Mon, 2 Nov 2015 23:48:49 +0000 (00:48 +0100)
committerMichael Vogel <icarus@dabo.de>
Mon, 2 Nov 2015 23:48:49 +0000 (00:48 +0100)
include/network.php

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