X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=plugins%2Faf_redditimgur%2Finit.php;h=59e3a760c666f68ba54939dee92ec38ef3fea384;hb=11d1a8a6935c0665671fd570d485c6f8db4fbbca;hp=82e3226a7c764c848b0cbbaa1f4731d0f1da699c;hpb=2eda9d9be40c783ae16c169c133e72c7196a6639;p=tt-rss.git diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 82e3226a..59e3a760 100755 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -1,5 +1,7 @@ host->get($this, "enable_content_dupcheck")) { if ($content_link) { - $content_href = db_escape_string($content_link->getAttribute("href")); - $entry_guid = db_escape_string($article["guid_hashed"]); + $content_href = $content_link->getAttribute("href"); + $entry_guid = $article["guid_hashed"]; $owner_uid = $article["owner_uid"]; if (DB_TYPE == "pgsql") { @@ -389,16 +391,18 @@ class Af_RedditImgur extends Plugin { $interval_qpart = "date_entered < DATE_SUB(NOW(), INTERVAL 1 DAY)"; } - $result = db_query("SELECT COUNT(id) AS cid + $sth = $this->pdo->prepare("SELECT COUNT(id) AS cid FROM ttrss_entries, ttrss_user_entries WHERE ref_id = id AND $interval_qpart AND - guid != '$entry_guid' AND - owner_uid = '$owner_uid' AND - content LIKE '%href=\"$content_href\">[link]%'"); + guid != ? AND + owner_uid = ? AND + content LIKE ?"); + + $sth->execute([$entry_guid, $owner_uid, "%href=\"$content_href\">[link]%"]); - if ($result) { - $num_found = db_fetch_result($result, 0, "cid"); + if ($row = $sth->fetch()) { + $num_found = $row['cid']; if ($num_found > 0) $article["force_catchup"] = true; }