From ecc92d92acbd5ac2255194c416c983ec09177302 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 15 Jul 2015 23:06:15 +0300 Subject: [PATCH] af_redditimgur: maybe fix duplicate album images --- plugins/af_redditimgur/init.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 2b71a8e9..023d7c18 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -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; } -- 2.39.5