Correctly return a stream even if error is encountered.
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 26 Oct 2009 18:32:16 +0000 (12:32 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 26 Oct 2009 18:35:45 +0000 (12:35 -0600)
imp/lib/Contents.php

index 693ef49..95d4eee 100644 (file)
@@ -252,7 +252,9 @@ class IMP_Contents
                 return $swrapper->fopen();
             }
         } catch (Horde_Imap_Client_Exception $e) {
-            return '';
+            return empty($options['stream'])
+                ? ''
+                : fopen('php://temp', 'r+');
         }
     }
 
@@ -289,7 +291,7 @@ class IMP_Contents
         } catch (Horde_Imap_Client_Exception $e) {
             return empty($options['stream'])
                 ? ''
-                : array();
+                : fopen('php://temp', 'r+');
         }
     }