diff options
author | Andrew Dolgov <[email protected]> | 2016-01-26 11:45:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2016-01-26 11:45:47 +0300 |
commit | 41245888f1c538f15d7ffa3a0ddc9310b60c98d7 (patch) | |
tree | 1be19b8234a1c80bd2ac88af9e455bf6032c7518 /classes/feeds.php | |
parent | 29c92d7b080152bfc8c60b90c185e2faab2a6bbb (diff) |
only stop inline feed updates with open_basedir enabled if there are any plugins that require CURL enabled
add plugin->flags() returning array with additional plugin information, currently only CURL requirement (optional)
Diffstat (limited to 'classes/feeds.php')
-rwxr-xr-x | classes/feeds.php | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index cb1b032d1..df0fd440b 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -166,12 +166,30 @@ class Feeds extends Handler_Protected { $method_split = explode(":", $method); - if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed) && !ini_get("open_basedir")) { + if ($method == "ForceUpdate" && $feed > 0 && is_numeric($feed)) { // Update the feed if required with some basic flood control - $result = $this->dbh->query( - "SELECT cache_images,".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated - FROM ttrss_feeds WHERE id = '$feed'"); + $any_needs_curl = false; + + if (ini_get("open_basedir")) { + $pluginhost = PluginHost::getInstance(); + foreach ($pluginhost->get_plugins() as $plugin) { + $flags = $plugin->flags(); + + if (isset($flags["needs_curl"]) && $flags["needs_curl"]) { + $any_needs_curl = true; + break; + } + } + } + + //if ($_REQUEST["debug"]) print "<!-- any_needs_curl: $any_needs_curl -->"; + + if (!$any_needs_curl) { + + $result = $this->dbh->query( + "SELECT cache_images," . SUBSTRING_FOR_DATE . "(last_updated,1,19) AS last_updated + FROM ttrss_feeds WHERE id = '$feed'"); if ($this->dbh->num_rows($result) != 0) { $last_updated = strtotime($this->dbh->fetch_result($result, 0, "last_updated")); @@ -182,9 +200,10 @@ class Feeds extends Handler_Protected { update_rss_feed($feed, true, true); } else { $this->dbh->query("UPDATE ttrss_feeds SET last_updated = '1970-01-01', last_update_started = '1970-01-01' - WHERE id = '$feed'"); + WHERE id = '$feed'"); } } + } } if ($method_split[0] == "MarkAllReadGR") { |