Update Server.php

This commit is contained in:
Lewis Cowles 2015-05-24 12:46:35 +01:00
parent 743ceff0de
commit 44a2080f3e

View File

@ -323,15 +323,15 @@ class Server
*/ */
public function numMessages($mailbox='') public function numMessages($mailbox='')
{ {
if ($mailbox===''){ if ($mailbox==='') {
return imap_num_msg( $this->getImapStream() ); return imap_num_msg($this->getImapStream());
} }
if (!$this->hasMailbox($mailbox) && $mailbox !== ''){ if (!$this->hasMailbox($mailbox) && $mailbox !== '') {
return 0; return 0;
} }
$oldMailbox = $this->getMailBox(); $oldMailbox = $this->getMailBox();
$this->setMailbox($mailbox); $this->setMailbox($mailbox);
$cnt = imap_num_msg($this->getImapStream()); $cnt = $this->numMessages();
$this->setMailbox($oldMailbox); $this->setMailbox($oldMailbox);
return $cnt; return $cnt;
} }