From 8da34e72c1d74d8fe74c02e256d3d959102717f9 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 8 May 2011 18:53:39 +0200 Subject: [PATCH] Fix erroneous unread count in some specific cases. Signed-off-by: Florent Bruneau --- banana/nntp.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } -- 2.1.4