]> git.wh0rd.org - tt-rss.git/commitdiff
plugins/af_readability: use PDO
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 07:44:43 +0000 (10:44 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 3 Dec 2017 07:44:43 +0000 (10:44 +0300)
plugins/af_readability/init.php

index 873eba1bae90c16c818412834966b38763033f60..10de118f9bbd31522410007345c26ff07285b42c 100755 (executable)
@@ -1,6 +1,7 @@
 <?php
 class Af_Readability extends Plugin {
 
+       /* @var PluginHost $host */
        private $host;
 
        function about() {
@@ -235,9 +236,10 @@ class Af_Readability extends Plugin {
 
                foreach ($enabled_feeds as $feed) {
 
-                       $result = db_query("SELECT id FROM ttrss_feeds WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]);
+                       $sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE id = ? AND owner_uid = ?");
+                       $sth->execute([$feed, $_SESSION['uid']]);
 
-                       if (db_num_rows($result) != 0) {
+                       if ($row = $sth->fetch()) {
                                array_push($tmp, $feed);
                        }
                }