format headlines list: normalize booleans for pdo mysql

This commit is contained in:
Andrew Dolgov 2018-12-08 08:23:18 +03:00
parent abaf597808
commit 41e967136f
1 changed files with 7 additions and 0 deletions

View File

@ -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;