]> git.wh0rd.org Git - tt-rss.git/commitdiff
Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION.
authorJustAMacUser <donotreply@example.org>
Sun, 22 Jan 2017 07:12:09 +0000 (02:12 -0500)
committerJustAMacUser <donotreply@example.org>
Sun, 22 Jan 2017 07:12:09 +0000 (02:12 -0500)
include/functions.php [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index de93267..17bd9f3
                $timeout = isset($options["timeout"]) ? $options["timeout"] : false;
                $timestamp = isset($options["timestamp"]) ? $options["timestamp"] : 0;
                $useragent = isset($options["useragent"]) ? $options["useragent"] : false;
+               $followlocation = isset($options["followlocation"]) ? $options["followlocation"] : true;
 
                $url = ltrim($url, ' ');
                $url = str_replace(' ', '%20', $url);
 
                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout ? $timeout : FILE_FETCH_CONNECT_TIMEOUT);
                        curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : FILE_FETCH_TIMEOUT);
-                       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("open_basedir"));
+                       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("open_basedir") && $followlocation);
                        curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
                        curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);