diff options
| -rw-r--r-- | app/Models/Category.php | 10 | ||||
| -rw-r--r-- | app/Models/Entry.php | 7 | ||||
| -rw-r--r-- | app/Models/Feed.php | 10 | ||||
| -rw-r--r-- | app/Models/Tag.php | 5 |
4 files changed, 25 insertions, 7 deletions
diff --git a/app/Models/Category.php b/app/Models/Category.php index da902d6bd..221e8644d 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -58,9 +58,15 @@ class FreshRSS_Category extends Minz_Model { public function lastUpdate(): int { return $this->lastUpdate; } - public function _lastUpdate(int $value): void { - $this->lastUpdate = $value; + + /** + * @param int|numeric-string $value + * 32-bit systems provide a string and will fail in year 2038 + */ + public function _lastUpdate(int|string $value): void { + $this->lastUpdate = (int)$value; } + public function inError(): bool { return $this->error; } 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; } diff --git a/app/Models/Feed.php b/app/Models/Feed.php index 143da0139..57bf9d7a4 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -308,9 +308,15 @@ class FreshRSS_Feed extends Minz_Model { public function _description(string $value): void { $this->description = $value == '' ? '' : $value; } - public function _lastUpdate(int $value): void { - $this->lastUpdate = $value; + + /** + * @param int|numeric-string $value + * 32-bit systems provide a string and will fail in year 2038 + */ + public function _lastUpdate(int|string $value): void { + $this->lastUpdate = (int)$value; } + public function _priority(int $value): void { $this->priority = $value; } diff --git a/app/Models/Tag.php b/app/Models/Tag.php index dc74dcabd..a6cc1ba73 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -49,7 +49,8 @@ class FreshRSS_Tag extends Minz_Model { return $this->nbUnread; } - public function _nbUnread(int $value): void { - $this->nbUnread = $value; + /** @param int|numeric-string $value */ + public function _nbUnread(int|string $value): void { + $this->nbUnread = (int)$value; } } |
