From: JustAMacUser Date: Sun, 22 Jan 2017 07:12:09 +0000 (-0500) Subject: Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION. X-Git-Tag: 17.1~3^2~1 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=fabfb9fc2aabedfb1045a2036e9eecae1d9ad300;p=tt-rss.git Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION. --- diff --git a/include/functions.php b/include/functions.php old mode 100755 new mode 100644 index de93267e..17bd9f37 --- a/include/functions.php +++ b/include/functions.php @@ -368,6 +368,7 @@ $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); @@ -388,7 +389,7 @@ 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);