A free, self-hostable news aggregator…
Fever integer type for numbers (#2946)
Alexandre Alapetiteb1aac20839f6
diff --git a/app/Models/Category.php b/app/Models/Category.phpindex 6956029ad..cee137138 100644--- a/app/Models/Category.php+++ b/app/Models/Category.php@@ -78,7 +78,7 @@ class FreshRSS_Category extends Minz_Model {}public function _id($id) {- $this->id = $id;+ $this->id = intval($id);if ($id == FreshRSS_CategoryDAO::DEFAULTCATEGORYID) {$this->_name(_t('gen.short.default_category'));}diff --git a/app/Models/Entry.php b/app/Models/Entry.phpindex f4cd82288..584a16862 100644--- a/app/Models/Entry.php+++ b/app/Models/Entry.php@@ -212,7 +212,7 @@ class FreshRSS_Entry extends Minz_Model {}private function _feedId($value) {$this->feed = null;- $this->feedId = $value;+ $this->feedId = intval($value);}public function _tags($value) {$this->hash = null;diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.phpindex 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);}diff --git a/app/Models/Feed.php b/app/Models/Feed.phpindex dd1c8ce22..34c036921 100644--- a/app/Models/Feed.php+++ b/app/Models/Feed.php@@ -180,7 +180,7 @@ class FreshRSS_Feed extends Minz_Model {}public function _id($value) {- $this->id = $value;+ $this->id = intval($value);}public function _url($value, $validate = true) {$this->hash = null;diff --git a/p/api/fever.php b/p/api/fever.phpindex b88ccc255..a714561da 100644--- a/p/api/fever.php+++ b/p/api/fever.php@@ -536,7 +536,7 @@ class FeverAPIcontinue;}$items[] = array(- 'id' => $entry->id(),+ 'id' => '' . $entry->id(),'feed_id' => $entry->feed(false),'title' => escapeToUnicodeAlternative($entry->title(), false),'author' => escapeToUnicodeAlternative(trim($entry->authors(true), '; '), false),