diff options
| author | 2020-05-03 13:39:16 +0200 | |
|---|---|---|
| committer | 2020-05-03 13:39:16 +0200 | |
| commit | b1aac20839f6e1f3e733774eeb5984ce7b08c246 (patch) | |
| tree | 3581e72c05a22fdb65624d53fd8481eb1c9a5da0 /app/Models/EntryDAO.php | |
| parent | 83ba09c2a5f0ad12e7b6536d1c3b7cb4a8072005 (diff) | |
Fever integer type for numbers (#2946)
* Fever integer type for feed ID
#Fix
https://github.com/FreshRSS/FreshRSS/issues/2940#issuecomment-623022435
* Fix feed_id
* Ensure string for entry ID
To be compatible with 32-bit platforms.
Before, the type was inconsistent depending on architecture + database
* Integer for entry count functions
Diffstat (limited to 'app/Models/EntryDAO.php')
| -rw-r--r-- | app/Models/EntryDAO.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php index 9ee59fc5a..db936479d 100644 --- a/app/Models/EntryDAO.php +++ b/app/Models/EntryDAO.php @@ -1031,8 +1031,8 @@ SQL; } $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); rsort($res); - $all = empty($res[0]) ? 0 : $res[0]; - $unread = empty($res[1]) ? 0 : $res[1]; + $all = empty($res[0]) ? 0 : intval($res[0]); + $unread = empty($res[1]) ? 0 : intval($res[1]); return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } @@ -1047,7 +1047,7 @@ SQL; return false; } $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return isset($res[0]) ? $res[0] : 0; + return isset($res[0]) ? intval($res[0]) : 0; } public function countNotRead($minPriority = null) { @@ -1061,7 +1061,7 @@ SQL; } $stm = $this->pdo->query($sql); $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); - return $res[0]; + return isset($res[0]) ? intval($res[0]) : 0; } public function countUnreadReadFavorites() { @@ -1089,8 +1089,8 @@ SQL; $stm->execute(); $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); rsort($res); - $all = empty($res[0]) ? 0 : $res[0]; - $unread = empty($res[1]) ? 0 : $res[1]; + $all = empty($res[0]) ? 0 : intval($res[0]); + $unread = empty($res[1]) ? 0 : intval($res[1]); return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } |
