aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2025-02-26 17:01:25 +0100
committerGravatar GitHub <noreply@github.com> 2025-02-26 17:01:25 +0100
commit5f6ef05ffc72fe5ce8e8fdd49aca30313e6f36d3 (patch)
tree07cfccb5d7d1245694ec7bde23f0ab95cdf3e2c1 /app/Models/Entry.php
parent943049890a53212b635004189dba874b96637031 (diff)
Fix bigint timestamps on 32-bit (#7375)
* Fix bigint timestamps on 32-bit fix https://github.com/FreshRSS/FreshRSS/issues/7374 SQL requests for BIGINT fields may return a string on 32-bit systems instead of an integer * Calculations may also be string
Diffstat (limited to 'app/Models/Entry.php')
-rw-r--r--app/Models/Entry.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 2454e4831..bc5ed2279 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -546,7 +546,12 @@ HTML;
$this->date = $value > 1 ? $value : time();
}
- public function _lastSeen(int $value): void {
+ /**
+ * @param int|numeric-string $value
+ * 32-bit systems provide a string and will fail in year 2038
+ */
+ public function _lastSeen(int|string $value): void {
+ $value = (int)$value;
$this->lastSeen = $value > 0 ? $value : 0;
}