summaryrefslogtreecommitdiff
path: root/plugins/af_unburn/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-05-07 15:36:14 +0400
committerAndrew Dolgov <[email protected]>2013-05-07 15:36:14 +0400
commit82076ce53113be9cc053f8740356e7e1b81e5643 (patch)
tree5eba36805f593ec7dd0aad671b5bcca0ae01cf53 /plugins/af_unburn/init.php
parent66af65f14b4f3c670bb3f9ca7b1c80081f9281d1 (diff)
parent23923fb29b345c1eea5b70a6df4d30395425bf37 (diff)
Merge branch 'master' into css-feedtree-counter
Conflicts: tt-rss.css
Diffstat (limited to 'plugins/af_unburn/init.php')
-rw-r--r--plugins/af_unburn/init.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php
index 9f0b6cb0d..a97502b12 100644
--- a/plugins/af_unburn/init.php
+++ b/plugins/af_unburn/init.php
@@ -1,7 +1,5 @@
<?php
class Af_Unburn extends Plugin {
-
- private $link;
private $host;
function about() {
@@ -11,7 +9,6 @@ class Af_Unburn extends Plugin {
}
function init($host) {
- $this->link = $host->get_link();
$this->host = $host;
$host->add_hook($host::HOOK_ARTICLE_FILTER, $this);
@@ -29,7 +26,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 +35,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);
@@ -117,7 +114,7 @@ class Af_Unburn extends Plugin {
preg_match("/(Location:|URI:)[^(\n)]*/", $header, $matches);
$url = trim(str_replace($matches[1],"",$matches[0]));
$url_parsed = parse_url($url);
- return (isset($url_parsed))? geturl($url, $referer):'';
+ return (isset($url_parsed))? geturl($url):'';
}
$oline='';
foreach($status as $key=>$eline){$oline.='['.$key.']'.$eline.' ';}
@@ -128,5 +125,10 @@ class Af_Unburn extends Plugin {
}
return $url;
}
+
+ function api_version() {
+ return 2;
+ }
+
}
?>