Make sure stream is rewound to the beginning.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Jul 2009 22:57:05 +0000 (16:57 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Jul 2009 22:57:05 +0000 (16:57 -0600)
framework/Imap_Client/lib/Horde/Imap/Client/Socket.php

index 43c1e07..4274d9f 100644 (file)
@@ -1197,6 +1197,9 @@ class Horde_Imap_Client_Socket extends Horde_Imap_Client_Base
              * for now, simply grab the contents of the stream and do a
              * strlen() call to determine the literal size to send to the
              * IMAP server. */
+            if (is_resource($m_data['data'])) {
+                rewind($m_data['data']);
+            }
             $text = $this->utils->removeBareNewlines(is_resource($m_data['data']) ? stream_get_contents($m_data['data']) : $m_data['data']);
             $datalength = strlen($text);