From b30abdadd2f7d846d40eaa2ddb6343291df30a91 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 21 Feb 2013 22:24:06 +0400 Subject: prevent article filters from modifying article GUID; add separate plugin_data field for this --- plugins/af_buttersafe/init.php | 4 ++-- plugins/af_explosm/init.php | 4 ++-- plugins/af_gocomics/init.php | 4 ++-- plugins/af_pennyarcade/init.php | 4 ++-- plugins/af_unburn/init.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/af_buttersafe/init.php b/plugins/af_buttersafe/init.php index 2b4279501..0715be3aa 100644 --- a/plugins/af_buttersafe/init.php +++ b/plugins/af_buttersafe/init.php @@ -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; diff --git a/plugins/af_explosm/init.php b/plugins/af_explosm/init.php index cd6efb2ee..b848bb0fb 100644 --- a/plugins/af_explosm/init.php +++ b/plugins/af_explosm/init.php @@ -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; diff --git a/plugins/af_gocomics/init.php b/plugins/af_gocomics/init.php index 2a5d3ba3c..829dda999 100644 --- a/plugins/af_gocomics/init.php +++ b/plugins/af_gocomics/init.php @@ -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; diff --git a/plugins/af_pennyarcade/init.php b/plugins/af_pennyarcade/init.php index e8c623f5e..5ac629914 100644 --- a/plugins/af_pennyarcade/init.php +++ b/plugins/af_pennyarcade/init.php @@ -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; diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php index d2bcf75d0..d09e2ad36 100644 --- a/plugins/af_unburn/init.php +++ b/plugins/af_unburn/init.php @@ -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; } } -- cgit v1.2.3