mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-22 20:01:29 +00:00
Added support to fetch_file_contents() to explicitly set CURLOPT_FOLLOWLOCATION.
This commit is contained in:
3
include/functions.php
Executable file → Normal file
3
include/functions.php
Executable file → Normal file
@@ -368,6 +368,7 @@
|
|||||||
$timeout = isset($options["timeout"]) ? $options["timeout"] : false;
|
$timeout = isset($options["timeout"]) ? $options["timeout"] : false;
|
||||||
$timestamp = isset($options["timestamp"]) ? $options["timestamp"] : 0;
|
$timestamp = isset($options["timestamp"]) ? $options["timestamp"] : 0;
|
||||||
$useragent = isset($options["useragent"]) ? $options["useragent"] : false;
|
$useragent = isset($options["useragent"]) ? $options["useragent"] : false;
|
||||||
|
$followlocation = isset($options["followlocation"]) ? $options["followlocation"] : true;
|
||||||
|
|
||||||
$url = ltrim($url, ' ');
|
$url = ltrim($url, ' ');
|
||||||
$url = str_replace(' ', '%20', $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_CONNECTTIMEOUT, $timeout ? $timeout : FILE_FETCH_CONNECT_TIMEOUT);
|
||||||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout ? $timeout : FILE_FETCH_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_MAXREDIRS, 20);
|
||||||
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user