From: Andrew Dolgov Date: Mon, 18 Aug 2014 14:41:19 +0000 (+0400) Subject: plugins: remove obsolete plugin_data/stored stuff X-Git-Tag: 1.14~31 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=129d62635430167fbdf837420ca952ccbef7a331;p=tt-rss.git plugins: remove obsolete plugin_data/stored stuff --- diff --git a/plugins/af_comics/filters/af_comics_cad.php b/plugins/af_comics/filters/af_comics_cad.php index fcc90781..43836724 100644 --- a/plugins/af_comics/filters/af_comics_cad.php +++ b/plugins/af_comics/filters/af_comics_cad.php @@ -9,7 +9,7 @@ class Af_Comics_Cad extends Af_ComicFilter { $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "cad-comic.com/cad/") !== FALSE) { - if (strpos($article["title"], "News:") === FALSE && strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { + if (strpos($article["title"], "News:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -22,12 +22,9 @@ class Af_Comics_Cad extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; } return true; diff --git a/plugins/af_comics/filters/af_comics_comicpress.php b/plugins/af_comics/filters/af_comics_comicpress.php index 5c4daa33..ec4b7ac5 100644 --- a/plugins/af_comics/filters/af_comics_comicpress.php +++ b/plugins/af_comics/filters/af_comics_comicpress.php @@ -16,8 +16,6 @@ class Af_Comics_ComicPress extends Af_ComicFilter { strpos($article["guid"], "happyjar.com") !== FALSE || strpos($article["guid"], "csectioncomics.com") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { - // lol at people who block clients by user agent // oh noes my ad revenue Q_Q @@ -36,12 +34,8 @@ class Af_Comics_ComicPress extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_darklegacy.php b/plugins/af_comics/filters/af_comics_darklegacy.php index d87a3da2..c03919b1 100644 --- a/plugins/af_comics/filters/af_comics_darklegacy.php +++ b/plugins/af_comics/filters/af_comics_darklegacy.php @@ -9,9 +9,6 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter { $owner_uid = $article["owner_uid"]; if (strpos($article["guid"], "darklegacycomics.com") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { - - print "DLC!" . $article["link"] . "\n"; $res = fetch_file_contents($article["link"], false, false, false, false, false, 0, @@ -34,12 +31,8 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php index 4c2233a3..f0e31cf8 100644 --- a/plugins/af_comics/filters/af_comics_dilbert.php +++ b/plugins/af_comics/filters/af_comics_dilbert.php @@ -9,7 +9,6 @@ class Af_Comics_Dilbert extends Af_ComicFilter { $owner_uid = $article["owner_uid"]; if (strpos($article["guid"], "dilbert.com") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -36,12 +35,8 @@ class Af_Comics_Dilbert extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_explosm.php b/plugins/af_comics/filters/af_comics_explosm.php index 7e062185..cba7ad0a 100644 --- a/plugins/af_comics/filters/af_comics_explosm.php +++ b/plugins/af_comics/filters/af_comics_explosm.php @@ -9,7 +9,6 @@ class Af_Comics_Explosm extends Af_ComicFilter { $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "explosm.net/comics") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -33,12 +32,8 @@ class Af_Comics_Explosm extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_gocomics.php b/plugins/af_comics/filters/af_comics_gocomics.php index d950dbe6..9b3c787d 100644 --- a/plugins/af_comics/filters/af_comics_gocomics.php +++ b/plugins/af_comics/filters/af_comics_gocomics.php @@ -9,7 +9,6 @@ class Af_Comics_GoComics extends Af_ComicFilter { $owner_uid = $article["owner_uid"]; if (strpos($article["guid"], "gocomics.com") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -42,12 +41,8 @@ class Af_Comics_GoComics extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_pa.php b/plugins/af_comics/filters/af_comics_pa.php index b44de9cf..a13857cc 100644 --- a/plugins/af_comics/filters/af_comics_pa.php +++ b/plugins/af_comics/filters/af_comics_pa.php @@ -6,10 +6,7 @@ class Af_Comics_Pa extends Af_ComicFilter { } function process(&$article) { - $owner_uid = $article["owner_uid"]; - if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "Comic:") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { if ($debug_enabled) { _debug("af_pennyarcade: Processing comic"); @@ -26,18 +23,13 @@ class Af_Comics_Pa extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } if (strpos($article["link"], "penny-arcade.com") !== FALSE && strpos($article["title"], "News Post:") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { if ($debug_enabled) { _debug("af_pennyarcade: Processing news post"); } @@ -73,12 +65,8 @@ class Af_Comics_Pa extends Af_ComicFilter { if ($basenode){ $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_comics/filters/af_comics_twp.php b/plugins/af_comics/filters/af_comics_twp.php index 156b2b68..ec43c137 100644 --- a/plugins/af_comics/filters/af_comics_twp.php +++ b/plugins/af_comics/filters/af_comics_twp.php @@ -6,10 +6,8 @@ class Af_Comics_Twp extends Af_ComicFilter { } function process(&$article) { - $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "threewordphrase.com") !== FALSE) { - if (strpos($article["plugin_data"], "af_comics,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -23,12 +21,8 @@ class Af_Comics_Twp extends Af_ComicFilter { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_comics,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } return true; } diff --git a/plugins/af_fsckportal/init.php b/plugins/af_fsckportal/init.php index 4a549027..4718eca9 100644 --- a/plugins/af_fsckportal/init.php +++ b/plugins/af_fsckportal/init.php @@ -16,9 +16,6 @@ class Af_Fsckportal extends Plugin { } function hook_article_filter($article) { - $owner_uid = $article["owner_uid"]; - - if (strpos($article["plugin_data"], "fsckportal,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @@ -41,11 +38,7 @@ class Af_Fsckportal extends Plugin { } $article["content"] = $doc->saveXML(); - $article["plugin_data"] = "fsckportal,$owner_uid:" . $article["plugin_data"]; - } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; } return $article; diff --git a/plugins/af_habr/init.php b/plugins/af_habr/init.php index d357956a..e6dc54c2 100644 --- a/plugins/af_habr/init.php +++ b/plugins/af_habr/init.php @@ -17,7 +17,6 @@ class Af_Habr extends Plugin { $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "habrahabr.ru") !== FALSE) { - if (strpos($article["plugin_data"], "af_habr,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -31,12 +30,8 @@ class Af_Habr extends Plugin { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "af_habr,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } } return $article; diff --git a/plugins/af_natgeo/init.php b/plugins/af_natgeo/init.php index 72354c1c..52a89e92 100644 --- a/plugins/af_natgeo/init.php +++ b/plugins/af_natgeo/init.php @@ -19,7 +19,6 @@ class Af_NatGeo extends Plugin { $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "nationalgeographic.com") !== FALSE) { - if (strpos($article["plugin_data"], "natgeo,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -39,12 +38,8 @@ class Af_NatGeo extends Plugin { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "natgeo,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } } return $article; diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index e81d908e..e513cc6f 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -15,12 +15,8 @@ class Af_RedditImgur extends Plugin { } function hook_article_filter($article) { - $owner_uid = $article["owner_uid"]; - - $force = false; if (strpos($article["link"], "reddit.com/r/") !== FALSE) { - if (strpos($article["plugin_data"], "redditimgur,$owner_uid:") === FALSE || $force) { $doc = new DOMDocument(); @$doc->loadHTML($article["content"]); @@ -123,12 +119,8 @@ class Af_RedditImgur extends Plugin { if ($node && $found) { $article["content"] = $doc->saveXML($node); - if (!$force) $article["plugin_data"] = "redditimgur,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } } return $article; diff --git a/plugins/af_sciam/init.php b/plugins/af_sciam/init.php index 658265e5..9c14515e 100644 --- a/plugins/af_sciam/init.php +++ b/plugins/af_sciam/init.php @@ -19,7 +19,6 @@ class Af_SciAm extends Plugin { $owner_uid = $article["owner_uid"]; if (strpos($article["link"], "scientificamerican.com") !== FALSE || strpos($article["link"], "rss.sciam.com") !== FALSE) { - if (strpos($article["plugin_data"], "sciam,$owner_uid:") === FALSE) { $doc = new DOMDocument(); @$doc->loadHTML(fetch_file_contents($article["link"])); @@ -33,12 +32,8 @@ class Af_SciAm extends Plugin { if ($basenode) { $article["content"] = $doc->saveXML($basenode); - $article["plugin_data"] = "sciam,$owner_uid:" . $article["plugin_data"]; } } - } else if (isset($article["stored"]["content"])) { - $article["content"] = $article["stored"]["content"]; - } } return $article; diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php index 5873ccdf..5c9bc138 100644 --- a/plugins/af_unburn/init.php +++ b/plugins/af_unburn/init.php @@ -24,8 +24,6 @@ class Af_Unburn extends Plugin { strpos($article["link"], "/~r/") !== FALSE || strpos($article["link"], "feedsportal.com") !== FALSE)) { - if (strpos($article["plugin_data"], "unburn,$owner_uid:") === FALSE) { - if (ini_get("safe_mode") || ini_get("open_basedir")) { $ch = curl_init(geturl($article["link"])); } else { @@ -42,7 +40,7 @@ class Af_Unburn extends Plugin { curl_setopt($ch, CURLOPT_PROXY, _CURL_HTTP_PROXY); } - $contents = @curl_exec($ch); + @curl_exec($ch); $real_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); @@ -73,9 +71,6 @@ class Af_Unburn extends Plugin { $article["plugin_data"] = "unburn,$owner_uid:" . $article["plugin_data"]; $article["link"] = $real_url; } - } else if (isset($article["stored"]["link"])) { - $article["link"] = $article["stored"]["link"]; - } } return $article;