boolean handling changes which probably won't break everything

master
Andrew Dolgov 7 years ago
parent 248c62a1cc
commit 7ccb4e91ff

@ -364,6 +364,8 @@ class Opml extends Handler_Protected {
$inverse = bool_to_sql_bool($filter["inverse"]); $inverse = bool_to_sql_bool($filter["inverse"]);
$title = $filter["title"]; $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) $sth = $this->pdo->prepare("INSERT INTO ttrss_filters2 (match_any_rule,enabled,inverse,title,owner_uid)
VALUES (?, ?, ?, ?, ?)"); VALUES (?, ?, ?, ?, ?)");

@ -941,19 +941,11 @@
} }
function sql_bool_to_bool($s) { function sql_bool_to_bool($s) {
if ($s == "t" || $s == "1" || strtolower($s) == "true") { return $s; //no-op for PDO
return true;
} else {
return false;
}
} }
function bool_to_sql_bool($s) { function bool_to_sql_bool($s) {
if ($s) { return (bool)$s; //no-op for PDO
return "true";
} else {
return "false";
}
} }
// Session caching removed due to causing wrong redirects to upgrade // Session caching removed due to causing wrong redirects to upgrade

Loading…
Cancel
Save