From 86bede27704e55ab21dc019dadf0b34c2a66c098 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 17 Nov 2013 18:12:15 +0100 Subject: Corrections install.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Première version fonctionnelle https://github.com/marienfressinaud/FreshRSS/issues/273 --- app/models/Entry.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/models/Entry.php') diff --git a/app/models/Entry.php b/app/models/Entry.php index c4856af8b..052e5abff 100755 --- a/app/models/Entry.php +++ b/app/models/Entry.php @@ -578,7 +578,9 @@ class EntryDAO extends Model_pdo { $stm = $this->bd->prepare ($sql); $stm->execute (); $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); - return array('total' => $res[0], 'unread' => $res[1], 'read' => $res[0] - $res[1]); + $all = empty($res[0]) ? 0 : $res[0]; + $unread = empty($res[1]) ? 0 : $res[1]; + return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } public function count ($minPriority = null) { $sql = 'SELECT COUNT(e.id) AS count FROM ' . $this->prefix . 'entry e INNER JOIN ' . $this->prefix . 'feed f ON e.id_feed = f.id'; @@ -607,7 +609,9 @@ class EntryDAO extends Model_pdo { $stm = $this->bd->prepare ($sql); $stm->execute (); $res = $stm->fetchAll (PDO::FETCH_COLUMN, 0); - return array('all' => $res[0], 'unread' => $res[1], 'read' => $res[0] - $res[1]); + $all = empty($res[0]) ? 0 : $res[0]; + $unread = empty($res[1]) ? 0 : $res[1]; + return array('all' => $all, 'unread' => $unread, 'read' => $all - $unread); } public function optimizeTable() { -- cgit v1.2.3