From: Michael M Slusarz Date: Tue, 25 Nov 2008 00:03:35 +0000 (-0700) Subject: Fix compose_attach_preview. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=433520b05b5253ce4c152b10341207a163d25c3d;p=horde.git Fix compose_attach_preview. --- diff --git a/imp/view.php b/imp/view.php index a42ac4c2d..775608306 100644 --- a/imp/view.php +++ b/imp/view.php @@ -49,8 +49,8 @@ $session_control = 'readonly'; require_once IMP_BASE . '/lib/base.php'; $actionID = Util::getFormData('actionID'); -$id = Util::getFormData('id'); $ctype = Util::getFormData('ctype'); +$id = Util::getFormData('id'); /* 'compose_attach_preview' doesn't use IMP_Contents since there is no * IMAP message data - rather, we must use the IMP_Compose object to @@ -59,12 +59,15 @@ if ($actionID == 'compose_attach_preview') { /* Initialize the IMP_Compose:: object. */ $imp_compose = &IMP_Compose::singleton(Util::getFormData('composeCache')); $mime = $imp_compose->buildAttachment($id); + if (empty($mime, 'PEAR_Error')) { + Horde::fatal('Could not load attachment', __FILE__, __LINE__); + } - /* Create a dummy IMP_Contents() object so we can use the view - * code below. Then use the 'view_attach' handler to output to - * the user. */ + /* Create a dummy IMP_Contents() object so we can use the view code below. + * Then use the 'view_attach' handler to output. */ $contents = new IMP_Contents($mime); $actionID = 'view_attach'; + $id = $mime->getMimeId(); } else { $index = Util::getFormData('index'); $mailbox = Util::getFormData('mailbox');