]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
disable FOLLOWLOCATION when under open_basedir
[tt-rss.git] / include / functions.php
index 621357ea6e07935bc1d3f87c6f42e0ba1d8a140f..0148d069dddc8d385108ba24f1ea48bfcc2d9a5a 100644 (file)
 
                if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) {
 
-                       if (ini_get("safe_mode")) {
+                       if (ini_get("safe_mode") || ini_get("open_basedir")) {
                                $ch = curl_init(geturl($url));
                        } else {
                                $ch = curl_init($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("safe_mode"));
+                       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, !ini_get("safe_mode") && !ini_get("open_basedir"));
                        curl_setopt($ch, CURLOPT_MAXREDIRS, 20);
                        curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);