]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/httpclient.php
[CORE][FRAMEWORK] URL_REGEX_VALID_PATH_CHARS didn't recognize the parenthesis sign.
[quix0rs-gnu-social.git] / lib / httpclient.php
index 04a365274d3e5cf1bf778322f68923aacda09232..819a5e6e0799140646ac01aa8c76cd6e0b058608 100644 (file)
@@ -116,7 +116,18 @@ class HTTPClient extends HTTP_Request2
 
     function __construct($url=null, $method=self::METHOD_GET, $config=array())
     {
-        $this->config['connect_timeout'] = common_config('http', 'connect_timeout') ?: $this->config['connect_timeout'];
+        if (is_int(common_config('http', 'timeout'))) {
+            // Reasonably you shouldn't set http/timeout to 0 because of 
+            // malicious remote servers that can cause infinitely long 
+            // responses... But the default in HTTP_Request2 is 0 for 
+            // some reason and should probably be considered a valid value.
+            $this->config['timeout'] = common_config('http', 'timeout');
+        } else {
+            common_log(LOG_ERR, 'config option http/timeout is not an integer value: '._ve(common_config('http', 'timeout')));
+        }
+        if (!empty(common_config('http', 'connect_timeout'))) {
+            $this->config['connect_timeout'] = common_config('http', 'connect_timeout');
+        }
         $this->config['max_redirs'] = 10;
         $this->config['follow_redirects'] = true;