Merge pull request 'Add workaround for boolean values being intergers with MySQL/PHP 8.1' (#65) from Schrottfresse/tt-rss:master into master

Reviewed-on: https://git.tt-rss.org/fox/tt-rss/pulls/65
This commit is contained in:
fox 2022-01-28 10:43:34 +03:00
commit b59bde7b45
1 changed files with 5 additions and 1 deletions

View File

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