mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-18 05:14:34 -04:00
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
This commit is contained in:
committed by
GitHub
parent
943049890a
commit
5f6ef05ffc
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user