From f0b6c14632e9af8bb16ccb32fef3ea78cfdb05bb Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 30 Mar 2015 20:13:19 -0500 Subject: [PATCH] Fix an issue where the IMAP stream isn't reloaded after it's lost. If $this->imapStream is lost, it will return 0. These conditionals evalute 0 as a set variable, therefore they don't reload the stream even though they should. --- src/Fetch/Server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Fetch/Server.php b/src/Fetch/Server.php index 1af1807..c5c9ced 100644 --- a/src/Fetch/Server.php +++ b/src/Fetch/Server.php @@ -250,7 +250,7 @@ class Server */ public function getImapStream() { - if (!isset($this->imapStream)) + if (empty($this->imapStream)) $this->setImapStream(); return $this->imapStream; @@ -302,7 +302,7 @@ class Server */ protected function setImapStream() { - if (isset($this->imapStream)) { + if (!empty($this->imapStream)) { if (!imap_reopen($this->imapStream, $this->getServerString(), $this->options, 1)) throw new \RuntimeException(imap_last_error()); } else {