From: Andrew Dolgov Date: Sat, 2 Dec 2017 11:02:01 +0000 (+0300) Subject: boolean handling changes which probably won't break everything X-Git-Tag: 17.12~49 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=7ccb4e91ff45cab907b43de1cc36a3b0ab5a025d boolean handling changes which probably won't break everything --- diff --git a/classes/opml.php b/classes/opml.php index 03156b79..5f70558b 100644 --- a/classes/opml.php +++ b/classes/opml.php @@ -364,6 +364,8 @@ class Opml extends Handler_Protected { $inverse = bool_to_sql_bool($filter["inverse"]); $title = $filter["title"]; + print "F: $title, $inverse, $enabled, $match_any_rule"; + $sth = $this->pdo->prepare("INSERT INTO ttrss_filters2 (match_any_rule,enabled,inverse,title,owner_uid) VALUES (?, ?, ?, ?, ?)"); diff --git a/include/functions.php b/include/functions.php index 31a0300d..0b301b82 100644 --- a/include/functions.php +++ b/include/functions.php @@ -941,19 +941,11 @@ } function sql_bool_to_bool($s) { - if ($s == "t" || $s == "1" || strtolower($s) == "true") { - return true; - } else { - return false; - } + return $s; //no-op for PDO } function bool_to_sql_bool($s) { - if ($s) { - return "true"; - } else { - return "false"; - } + return (bool)$s; //no-op for PDO } // Session caching removed due to causing wrong redirects to upgrade