Browse Source

format headlines list: normalize booleans for pdo mysql

Andrew Dolgov 1 year ago
parent
commit
41e967136f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      classes/feeds.php

+ 7 - 0
classes/feeds.php

@@ -242,6 +242,13 @@ class Feeds extends Handler_Protected {
 
 				$id = $line["id"];
 
+				// frontend doesn't expect pdo returning booleans as strings on mysql
+				if (DB_TYPE == "mysql") {
+					foreach (["unread", "marked", "published"] as $k) {
+						$line[$k] = $line[$k] === "1";
+					}
+				}
+
 				// normalize archived feed
 				if ($line['feed_id'] === null) {
 					$line['feed_id'] = 0;