]> git.wh0rd.org Git - tt-rss.git/commitdiff
disable FOLLOWLOCATION when under open_basedir
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 16:40:14 +0000 (20:40 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 16 Apr 2013 16:40:14 +0000 (20:40 +0400)
include/functions.php
plugins/af_unburn/init.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);
index 9f0b6cb0d8d4717d05244ce407f127f3f6cec68f..f3cc1eefa5f89f471dd5e4d9809139ce9f8c88e1 100644 (file)
@@ -29,7 +29,7 @@ class Af_Unburn extends Plugin {
 
                        if (strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) {
 
-                               if (ini_get("safe_mode")) {
+                               if (ini_get("safe_mode") || ini_get("open_basedir")) {
                                        $ch = curl_init(geturl($article["link"]));
                                } else {
                                        $ch = curl_init($article["link"]);
@@ -38,7 +38,7 @@ class Af_Unburn extends Plugin {
                                curl_setopt($ch, CURLOPT_TIMEOUT, 5);
                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                curl_setopt($ch, CURLOPT_HEADER, true);
-                               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_USERAGENT, SELF_USER_AGENT);
 
                                $contents = @curl_exec($ch);