From 8bff77c45ef87322fce0854e6f189f76604f5b93 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Wed, 6 Dec 2023 08:51:42 +0100 Subject: Fix export (#5927) Regression from https://github.com/FreshRSS/FreshRSS/pull/5830 --- app/Models/DatabaseDAO.php | 13 +++++++++++++ app/Models/TagDAO.php | 2 ++ 2 files changed, 15 insertions(+) (limited to 'app/Models') diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index 05ca98355..7dbe1db3f 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -407,4 +407,17 @@ SQL; } } } + + /** + * Ensure that some PDO columns are `string` and not `bigint`. + * @param array $table + * @param array $columns + */ + public static function pdoString(array &$table, array $columns): void { + foreach ($columns as $column) { + if (isset($table[$column])) { + $table[$column] = (string)$table[$column]; + } + } + } } diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php index bd52223a8..8587e576f 100644 --- a/app/Models/TagDAO.php +++ b/app/Models/TagDAO.php @@ -147,6 +147,8 @@ SQL; return; } while ($row = $stm->fetch(PDO::FETCH_ASSOC)) { + FreshRSS_DatabaseDAO::pdoInt($row, ['id_tag']); + FreshRSS_DatabaseDAO::pdoString($row, ['id_entry']); yield $row; } } -- cgit v1.2.3