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

index 911adb6b88d98bfa50b4d33ef22a910f24a66993..cc70e2dffea23a2ff934079f0c154af57e282966 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 class Auto_Assign_Labels extends Plugin {
 
+       /* @var PluginHost $host */
        private $host;
 
        function about() {
@@ -18,9 +19,10 @@ class Auto_Assign_Labels extends Plugin {
        function get_all_labels_filter_format($owner_uid) {
                $rv = array();
 
-               $result = db_query("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = " . $owner_uid);
+               $sth = $this->pdo->prepare("SELECT id, fg_color, bg_color, caption FROM ttrss_labels2 WHERE owner_uid = ?");
+               $sth->execute([$owner_uid]);
 
-               while ($line = db_fetch_assoc($result)) {
+               while ($line = $sth->fetch()) {
                        array_push($rv, array(Labels::label_to_feed_id($line["id"]),
                                $line["caption"], $line["fg_color"], $line["bg_color"]));
                }