From: Michael M Slusarz Date: Mon, 6 Jul 2009 05:17:22 +0000 (-0600) Subject: Fix rewind of stream X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=efd14442b0b1934394b1ab946ddc703fe6b3c0a3;p=horde.git Fix rewind of stream --- diff --git a/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Pop3.php b/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Pop3.php index 76de7498a..b241b7429 100644 --- a/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Pop3.php +++ b/framework/Imap_Client/lib/Horde/Imap/Client/Socket/Pop3.php @@ -896,12 +896,11 @@ class Horde_Imap_Client_Socket_Pop3 extends Horde_Imap_Client_Base case Horde_Imap_Client::FETCH_STRUCTURE: foreach ($seq_ids as $id) { - if ($tmp = $this->_pop3Cache('msg', $id)) { + $tmp = false; + if ($ptr = $this->_pop3Cache('msg', $id)) { try { - $tmp = Horde_Mime_Part::parseMessage(stream_get_contents($tmp), array('structure' => empty($c_val['parse']))); - } catch (Horde_Exception $e) { - $tmp = false; - } + $tmp = Horde_Mime_Part::parseMessage(stream_get_contents($ptr), array('structure' => empty($c_val['parse']))); + } catch (Horde_Exception $e) {} } $ret[$id]['structure'] = $tmp; } @@ -989,6 +988,9 @@ class Horde_Imap_Client_Socket_Pop3 extends Horde_Imap_Client_Base protected function _pop3Cache($type, $index = null, $data = null) { if (isset($this->_temp['pop3cache'][$index][$type])) { + if ($type == 'msg') { + rewind($this->_temp['pop3cache'][$index][$type]); + } return $this->_temp['pop3cache'][$index][$type]; }