]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
filters: remove sql_bool_to_bool()
[tt-rss.git] / include / functions.php
index 1d7033c899b46e773d4677a4df9c62947b3630b1..e781eee51fab1c5841696091052662086aad15f5 100644 (file)
        }
 
        function checkbox_to_sql_bool($val) {
-               return ($val == "on") ? true : false;
+               return ($val == "on") ? 1 : 0;
        }
 
        function uniqid_short() {
                $sth = $pdo->prepare("SELECT access_key FROM ttrss_access_keys
                                WHERE feed_id = ? AND is_cat = ?
                                AND owner_uid = ?");
-               $sth->execute([$feed_id, $is_cat, $owner_uid]);
+               $sth->execute([$feed_id, (int)$is_cat, $owner_uid]);
 
                if ($row = $sth->fetch()) {
                        return $row["access_key"];
                                        (access_key, feed_id, is_cat, owner_uid)
                                        VALUES (?, ?, ?, ?)");
 
-                       $sth->execute([$key, $feed_id, $is_cat, $owner_uid]);
+                       $sth->execute([$key, $feed_id, (int)$is_cat, $owner_uid]);
 
                        return $key;
                }