]> git.wh0rd.org Git - tt-rss.git/commitdiff
af_redditimgur: maybe fix duplicate album images
authorAndrew Dolgov <noreply@fakecake.org>
Wed, 15 Jul 2015 20:06:15 +0000 (23:06 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Wed, 15 Jul 2015 20:06:15 +0000 (23:06 +0300)
plugins/af_redditimgur/init.php

index 2b71a8e9dbe7200fa6966ecc9b29eeb5739494dc..023d7c18164068d2c5cb5ea60bed3a4b14f0b994 100644 (file)
@@ -188,9 +188,11 @@ class Af_RedditImgur extends Plugin {
 
                                                        foreach ($aentries as $aentry) {
 
-                                                               if (!in_array($aentry->getAttribute("content"), $urls)) {
+                                                               $url = str_replace("?fb", "", $aentry->getAttribute("content"));
+
+                                                               if (!in_array($url, $urls)) {
                                                                        $img = $doc->createElement('img');
-                                                                       $img->setAttribute("src", str_replace("?fb", "", $aentry->getAttribute("content")));
+                                                                       $img->setAttribute("src", $url);
                                                                        $entry->parentNode->insertBefore($doc->createElement('br'), $entry);
 
                                                                        $br = $doc->createElement('br');
@@ -198,7 +200,7 @@ class Af_RedditImgur extends Plugin {
                                                                        $entry->parentNode->insertBefore($img, $entry);
                                                                        $entry->parentNode->insertBefore($br, $entry);
 
-                                                                       array_push($urls, $aentry->getAttribute("content"));
+                                                                       array_push($urls, $url);
 
                                                                        $found = true;
                                                                }