From 4c0869c6621bfdc78ea2abb674907b5f1b0014d9 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 26 Oct 2009 12:32:16 -0600 Subject: [PATCH] Correctly return a stream even if error is encountered. --- imp/lib/Contents.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imp/lib/Contents.php b/imp/lib/Contents.php index 693ef495d..95d4eeeb3 100644 --- a/imp/lib/Contents.php +++ b/imp/lib/Contents.php @@ -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+'); } } -- 2.11.0