1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-06-20 11:16:36 +02:00

Add workaround for boolean values being intergers with MySQL/PHP 8.1

This commit is contained in:
Schrottfresse 2022-01-28 08:37:29 +01:00
parent 478c9b64a9
commit 931e33c381

View File

@ -195,7 +195,11 @@ 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) {
$line[$k] = $line[$k] === "1";
if (is_integer($line[$k])) {
$line[$k] = $line[$k] === 1;
} else {
$line[$k] = $line[$k] === "1";
}
}
}