summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJustAMacUser <[email protected]>2017-01-22 02:12:09 -0500
committerJustAMacUser <[email protected]>2017-01-22 02:12:09 -0500
commitfabfb9fc2aabedfb1045a2036e9eecae1d9ad300 (patch)
treececde1d0d7f00fd7aa420a7e034bc271a8d0c6dd /include
parent0047f2578f126cb6de2eed928e86ed7340c3854d (diff)
Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION.
Diffstat (limited to 'include')
-rw-r--r--[-rwxr-xr-x]include/functions.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/functions.php b/include/functions.php
index de93267ee..17bd9f371 100755..100644
--- 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);