From 582ff3cf6e617ccb6d6164da7381db80a0183127 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 5 Jul 2016 11:01:36 +0300 Subject: [PATCH] af_redditimgur: make sure content_link is defined even if content dupcheck is disabled --- plugins/af_redditimgur/init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 2e074813..8243b94c 100755 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -301,8 +301,9 @@ class Af_RedditImgur extends Plugin { @$doc->loadHTML($article["content"]); $xpath = new DOMXPath($doc); + $content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0); + if ($this->host->get($this, "enable_content_dupcheck")) { - $content_link = $xpath->query("(//a[contains(., '[link]')])")->item(0); if ($content_link) { $content_href = db_escape_string($content_link->getAttribute("href")); -- 2.39.5