]> git.wh0rd.org Git - tt-rss.git/commitdiff
some more pdo stuff
authorAndrew Dolgov <noreply@fakecake.org>
Fri, 1 Dec 2017 07:35:22 +0000 (10:35 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Fri, 1 Dec 2017 07:35:22 +0000 (10:35 +0300)
include/functions.php

index 1f9c80a028b6f27748ef0d5e6290ac87385733dd..58f4ba31cdc172bfc8412cc61d79a00a8dc4f7ed 100644 (file)
         $profile = $profile ? $profile : null;
 
                $u_sth = $pdo->prepare("SELECT pref_name
-                       FROM ttrss_user_prefs WHERE owner_uid = ? AND profile = ?");
-               $u_sth->execute([$uid, $profile]);
+                       FROM ttrss_user_prefs WHERE owner_uid = :uid AND 
+                               (:profile IS NULL AND profile is NULL OR profile = :profile)");
+               $u_sth->execute(['uid' => $uid, 'profile' => $profile]);
 
                $active_prefs = array();
 
                $pdo = Db::pdo();
 
                $sth = $pdo->prepare("SELECT id FROM ttrss_feed_categories
-                               WHERE $parent_qpart AND title = '$feed_cat' AND owner_uid = ?");
+                               WHERE parent_cat = ? AND title = '$feed_cat' AND owner_uid = ?");
 
                if (db_num_rows($result) == 0) {