Browse Source

boolean handling changes which probably won't break everything

Andrew Dolgov 6 years ago
parent
commit
7ccb4e91ff
2 changed files with 4 additions and 10 deletions
  1. 2 0
      classes/opml.php
  2. 2 10
      include/functions.php

+ 2 - 0
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 (?, ?, ?, ?, ?)");
 

+ 2 - 10
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