]> git.wh0rd.org Git - tt-rss.git/commitdiff
updates: auto-disable CURL if open_basedir is enabled, notify possible issues w/...
authorAndrew Dolgov <fox@fakecake.org>
Wed, 13 Jan 2016 15:12:31 +0000 (18:12 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Wed, 13 Jan 2016 15:12:31 +0000 (18:12 +0300)
classes/pref/prefs.php
include/functions.php
include/rssfuncs.php

index b78aa4d62331bdae364fb85809cf0a5b60f9bbf2..1988649a5a0e7d6c74a5f13f71e49e609b3a3732 100644 (file)
@@ -709,6 +709,10 @@ class Pref_Prefs extends Handler_Protected {
 
                print_notice(__("Download more plugins at tt-rss.org <a class=\"visibleLink\" target=\"_blank\" href=\"http://tt-rss.org/forum/viewforum.php?f=22\">forums</a> or <a target=\"_blank\" class=\"visibleLink\" href=\"http://tt-rss.org/wiki/Plugins\">wiki</a>."));
 
+               if (ini_get("open_basedir") && function_exists("curl_init") && !defined("NO_CURL")) {
+                       print_warning("Your PHP configuration has open_basedir restrictions enabled. Some plugins relying on CURL for functionality may not work correctly.");
+               }
+
                print "<form dojoType=\"dijit.form.Form\" id=\"changePluginsForm\">";
 
                print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
index b928a030d5d766718fcedc6b43e0e5c5f26a9d22..b558b0e6c539004b0ee23a5fe061debe3c95f39b 100755 (executable)
                if (strpos($url, "//") === 0)
                        $url = 'http:' . $url;
 
-               if (!defined('NO_CURL') && function_exists('curl_init')) {
+               if (!defined('NO_CURL') && function_exists('curl_init') && !ini_get("open_basedir")) {
 
                        $fetch_curl_used = true;
 
index ad956cd2a587e073cc2289ff3990415e11f9ab72..fcecbf67069cf001e41da834513bab359734b2e0 100755 (executable)
                        // fetch feed from source
                        if (!$feed_data) {
                                _debug("fetching [$fetch_url]...", $debug_enabled);
+
+                               if (ini_get("open_basedir") && function_exists("curl_init")) {
+                                       _debug("not using CURL due to open_basedir restrictions");
+                               }
+
                                _debug("If-Modified-Since: ".gmdate('D, d M Y H:i:s \G\M\T', $last_article_timestamp), $debug_enabled);
 
                                $feed_data = fetch_file_contents($fetch_url, false,