aboutsummaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-12-06 08:51:42 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-06 08:51:42 +0100
commit8bff77c45ef87322fce0854e6f189f76604f5b93 (patch)
tree18190bbc6fddab8e7f509a79ef75b27c6c2f7497 /app/Models
parent133892a89e065cd98635c21bf5a886cfed08aeb8 (diff)
Fix export (#5927)
Regression from https://github.com/FreshRSS/FreshRSS/pull/5830
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/DatabaseDAO.php13
-rw-r--r--app/Models/TagDAO.php2
2 files changed, 15 insertions, 0 deletions
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<string|int|null> $table
+ * @param array<string> $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;
}
}