From d6503c2984ab1110ca4cc5a28445976c4cfee5c2 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 4 Jun 2009 10:43:17 -0600 Subject: [PATCH] Don't strip trailing ws for literal data; fix error detection --- framework/Imap_Client/lib/Horde/Imap/Client/Socket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php index d1155ca7a..8f9b8aeaf 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket.php @@ -3233,7 +3233,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base } } - if ($data === false) { + if (!strlen($data)) { if ($this->_debug) { fwrite($this->_debug, '[ERROR: IMAP read error.]' . "\n"); } @@ -3244,7 +3244,7 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base fwrite($this->_debug, 'S (' . microtime(true) . '): ' . ($binary ? '[BINARY DATA - ' . $len . ' bytes]' : $data)); } - return rtrim($data); + return is_null($len) ? rtrim($data) : $data; } /** -- 2.11.0