]> git.wh0rd.org - tt-rss.git/blobdiff - classes/rpc.php
completeLabels: use prepare() not query()
[tt-rss.git] / classes / rpc.php
index d8ab5d37f1f939e8e0f3702d7d9feaaa2937216b..cc036736fb37f78fc8b647e5112cccad83bdc76c 100755 (executable)
@@ -9,6 +9,9 @@ class RPC extends Handler_Protected {
 
        function setprofile() {
                $_SESSION["profile"] = $_REQUEST["id"];
+
+               // default value
+               if (!$_SESSION["profile"]) $_SESSION["profile"] = null;
        }
 
        function remprofiles() {
@@ -331,7 +334,7 @@ class RPC extends Handler_Protected {
        function completeLabels() {
                $search = $_REQUEST["search"];
 
-               $sth = $this->pdo->query("SELECT DISTINCT caption FROM
+               $sth = $this->pdo->prepare("SELECT DISTINCT caption FROM
                                ttrss_labels2
                                WHERE owner_uid = ? AND
                                LOWER(caption) LIKE LOWER(?) ORDER BY caption
@@ -345,22 +348,6 @@ class RPC extends Handler_Protected {
                print "</ul>";
        }
 
-       function purge() {
-               $ids = explode(",", $_REQUEST["ids"]);
-               $days = (int) $_REQUEST["days"];
-
-               $sth = $this->pdo->prepare("SELECT id FROM ttrss_feeds WHERE
-                               id = ? AND owner_uid = ?");
-
-               foreach ($ids as $id) {
-                       $sth->execute([$id, $_SESSION['uid']]);
-
-                       if ($sth->fetch()) {
-                               purge_feed($id, $days);
-                       }
-               }
-       }
-
        function updateFeedBrowser() {
                if (defined('_DISABLE_FEED_BROWSER') && _DISABLE_FEED_BROWSER) return;