1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-27 02:01:29 +00:00

prevent article filters from modifying article GUID; add separate plugin_data field for this

This commit is contained in:
Andrew Dolgov
2013-02-21 22:24:06 +04:00
parent 7bfb3dabdd
commit b30abdadd2
6 changed files with 39 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ class Af_Buttersafe extends Plugin {
$owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "buttersafe.com") !== FALSE &&
strpos($article["guid"], "buttersafe,$owner_uid:") === FALSE) {
strpos($article["plugin_data"], "buttersafe,$owner_uid:") === FALSE) {
$doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"]));
@@ -48,7 +48,7 @@ class Af_Buttersafe extends Plugin {
}
}
$article["guid"] = "buttersafe,$owner_uid:" . $article["guid"];
$article["plugin_data"] = "buttersafe,$owner_uid:" . $article["plugin_data"];
}
return $article;

View File

@@ -21,7 +21,7 @@ class Af_Explosm extends Plugin {
$owner_uid = $article["owner_uid"];
if (strpos($article["link"], "explosm.net/comics") !== FALSE &&
strpos($article["guid"], "explosm,$owner_uid:") === FALSE) {
strpos($article["plugin_data"], "explosm,$owner_uid:") === FALSE) {
$doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"]));
@@ -48,7 +48,7 @@ class Af_Explosm extends Plugin {
}
}
$article["guid"] = "explosm,$owner_uid:" . $article["guid"];
$article["plugin_data"] = "explosm,$owner_uid:" . $article["plugin_data"];
}
return $article;

View File

@@ -20,7 +20,7 @@ class Af_GoComics extends Plugin {
function hook_article_filter($article) {
$owner_uid = $article["owner_uid"];
if (strpos($article["guid"], "gocomics.com") !== FALSE && strpos($article["guid"], "gocomics,$owner_uid:") === FALSE) {
if (strpos($article["guid"], "gocomics.com") !== FALSE && strpos($article["plugin_data"], "gocomics,$owner_uid:") === FALSE) {
$doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"]));
@@ -47,7 +47,7 @@ class Af_GoComics extends Plugin {
}
}
$article["guid"] = "gocomics,$owner_uid:" . $article["guid"];
$article["plugin_data"] = "gocomics,$owner_uid:" . $article["plugin_data"];
}
return $article;

View File

@@ -21,7 +21,7 @@ class Af_PennyArcade extends Plugin {
$owner_uid = $article["owner_uid"];
if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "Comic:") !== FALSE &&
strpos($article["guid"], "pennyarcade,$owner_uid:") === FALSE) {
strpos($article["plugin_data"], "pennyarcade,$owner_uid:") === FALSE) {
$doc = new DOMDocument();
@$doc->loadHTML(fetch_file_contents($article["link"]));
@@ -48,7 +48,7 @@ class Af_PennyArcade extends Plugin {
}
}
$article["guid"] = "pennyarcade,$owner_uid:" . $article["guid"];
$article["plugin_data"] = "pennyarcade,$owner_uid:" . $article["plugin_data"];
}
return $article;

View File

@@ -26,7 +26,7 @@ class Af_Unburn extends Plugin {
if ((strpos($article["link"], "feedproxy.google.com") !== FALSE ||
strpos($article["link"], "/~r/") !== FALSE ||
strpos($article["link"], "feedsportal.com") !== FALSE) &&
strpos($article["guid"], "unburn,$owner_uid:") === FALSE) {
strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) {
$ch = curl_init($article["link"]);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
@@ -62,7 +62,7 @@ class Af_Unburn extends Plugin {
$real_url = preg_replace("/\?$/", "", $real_url);
$article["guid"] = "unburn,$owner_uid:" . $article["guid"];
$article["plugin_data"] = "unburn,$owner_uid:" . $article["plugin_data"];
$article["link"] = $real_url;
}
}