From: Florent Bruneau Date: Sun, 8 May 2011 16:53:39 +0000 (+0200) Subject: Fix erroneous unread count in some specific cases. X-Git-Url: http://git.polytechnique.org/?p=banana.git;a=commitdiff_plain;h=8da34e72c1d74d8fe74c02e256d3d959102717f9 Fix erroneous unread count in some specific cases. Signed-off-by: Florent Bruneau --- diff --git a/banana/nntp.inc.php b/banana/nntp.inc.php index a880dd0..910075d 100644 --- a/banana/nntp.inc.php +++ b/banana/nntp.inc.php @@ -89,7 +89,12 @@ class BananaNNTP extends BananaNNTPCore implements BananaProtocoleInterface foreach ($this->boxes as $group=>&$desc) { list($msgnum, $first, $last, $groupname) = $this->group($group); $this->ingroup = $group; - $new = count($this->newnews($group, $since)); + $new = $this->newnews($group, $since); + if (!is_array($new)) { + $new = 0; + } else { + $new = count($new); + } $desc['msgnum'] = $msgnum; $desc['unread'] = $new; }