diff options
author | YoungMin Park <[email protected]> | 2014-11-04 11:49:43 +0900 |
---|---|---|
committer | YoungMin Park <[email protected]> | 2014-11-04 11:49:43 +0900 |
commit | a5bbb2bec133bdee08b361628f32430ae3884107 (patch) | |
tree | b203105149ec234ebe155d5718d2cbb6390b4a45 /plugins/af_redditimgur/init.php | |
parent | 12727ad17d125eb2f3f243231ccca1cb0a5a7b4b (diff) | |
parent | 2f43089de1ead3f164b8b31967d1abbb784319fa (diff) |
Merge pull request #1 from gothfox/master
Update from original
Diffstat (limited to 'plugins/af_redditimgur/init.php')
-rw-r--r-- | plugins/af_redditimgur/init.php | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 2e466f167..e513cc6f4 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"]); @@ -62,7 +58,7 @@ class Af_RedditImgur extends Plugin { $aentries = $axpath->query('(//img[@src])'); foreach ($aentries as $aentry) { - if (preg_match("/^http:\/\/i.imgur.com\/$token\./", $aentry->getAttribute("src"))) { + if (preg_match("/\/\/i.imgur.com\/$token\./", $aentry->getAttribute("src"))) { $img = $doc->createElement('img'); $img->setAttribute("src", $aentry->getAttribute("src")); @@ -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; |