summaryrefslogtreecommitdiff
path: root/app/models/Entry.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 18:12:15 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-17 18:12:15 +0100
commit86bede27704e55ab21dc019dadf0b34c2a66c098 (patch)
treeadbc3f6571a0ec11ded906dee959152cf3e5f337 /app/models/Entry.php
parent642d1d378149db97e8e510b15ff6d9ec5f54b4d2 (diff)
Corrections install.php
Première version fonctionnelle https://github.com/marienfressinaud/FreshRSS/issues/273
Diffstat (limited to 'app/models/Entry.php')
-rwxr-xr-xapp/models/Entry.php8
1 files changed, 6 insertions, 2 deletions
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() {