summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-01-13 18:12:31 +0300
committerAndrew Dolgov <[email protected]>2016-01-13 18:12:31 +0300
commit312742db6efc22a844a5f0a9d95f0282722354dc (patch)
tree7dd2a3400daafb69491c1fe61f1f24cbda1f9c39
parent393fc7d6b5e634c9618dac415252eaf40939cf31 (diff)
updates: auto-disable CURL if open_basedir is enabled, notify possible issues w/ plugins
-rw-r--r--classes/pref/prefs.php4
-rwxr-xr-xinclude/functions.php2
-rwxr-xr-xinclude/rssfuncs.php5
3 files changed, 10 insertions, 1 deletions
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index b78aa4d62..1988649a5 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -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\">
diff --git a/include/functions.php b/include/functions.php
index b928a030d..b558b0e6c 100755
--- a/include/functions.php
+++ b/include/functions.php
@@ -347,7 +347,7 @@
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;
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index ad956cd2a..fcecbf670 100755
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -399,6 +399,11 @@
// 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,