diff options
author | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
---|---|---|
committer | Art4 <[email protected]> | 2015-02-19 23:17:43 +0100 |
commit | d9c042c4c536f1afbf206aeea09b0b127b7b6418 (patch) | |
tree | 9d7ef18c6d9d4c8f8f4d1c9a5dbfceeb9fd5acf4 /plugins/af_redditimgur | |
parent | cf42b79120290ee5866136a0c4656e6999f06045 (diff) | |
parent | 4ca621a36016de1fbb5447e1c1de0b607ba94a7c (diff) |
Merge branch 'master' into patch-1
Conflicts:
locale/de_DE/LC_MESSAGES/messages.po
Diffstat (limited to 'plugins/af_redditimgur')
-rw-r--r-- | plugins/af_redditimgur/init.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index e513cc6f4..a23b3527f 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -42,7 +42,7 @@ class Af_RedditImgur extends Plugin { // links to imgur pages $matches = array(); - if (preg_match("/^http:\/\/imgur.com\/([^\.\/]+$)/", $entry->getAttribute("href"), $matches)) { + if (preg_match("/^https?:\/\/imgur.com\/([^\.\/]+$)/", $entry->getAttribute("href"), $matches)) { $token = $matches[1]; @@ -77,7 +77,7 @@ class Af_RedditImgur extends Plugin { } // linked albums, ffs - if (preg_match("/^http:\/\/imgur.com\/(a|album)\/[^\.]+$/", $entry->getAttribute("href"), $matches)) { + if (preg_match("/^https?:\/\/imgur.com\/(a|album)\/[^\.]+$/", $entry->getAttribute("href"), $matches)) { $album_content = fetch_file_contents($entry->getAttribute("href"), false, false, false, false, 10); @@ -88,11 +88,11 @@ class Af_RedditImgur extends Plugin { if ($adoc) { $axpath = new DOMXPath($adoc); - $aentries = $axpath->query("//div[@class='image']//a[@href and @class='zoom']"); + $aentries = $axpath->query("//meta[@property='og:image']"); foreach ($aentries as $aentry) { $img = $doc->createElement('img'); - $img->setAttribute("src", $aentry->getAttribute("href")); + $img->setAttribute("src", $aentry->getAttribute("content")); $entry->parentNode->insertBefore($doc->createElement('br'), $entry); $br = $doc->createElement('br'); |