Fix bugs introduced with latest compose/contents changes
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 27 Sep 2010 17:19:11 +0000 (11:19 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 27 Sep 2010 17:25:01 +0000 (11:25 -0600)
imp/compose-dimp.php
imp/lib/Ui/Compose.php

index 6ddcea8..e705678 100644 (file)
@@ -80,7 +80,7 @@ case 'reply_list':
         break;
     }
 
-    $reply_msg = $imp_compose->replyMessage($vars->type, reset($contents), $header['to']);
+    $reply_msg = $imp_compose->replyMessage($vars->type, $contents, $header['to']);
     $msg = $reply_msg['body'];
     $header = $reply_msg['headers'];
     $header['replytype'] = 'reply';
@@ -128,9 +128,7 @@ case 'forward_both':
 
         $rte = $show_editor = ($prefs->getValue('compose_html') && $_SESSION['imp']['rteavail']);
     } else {
-    if (!($contents = $imp_ui->getContents($vars))) {
-        break;
-    }
+
     try {
         $contents = $imp_ui->getContents($vars);
     } catch (IMP_Compose_Exception $e) {
@@ -162,7 +160,7 @@ case 'forward_both':
 case 'forward_redirect':
     try {
         $contents = $imp_ui->getContents($vars);
-        $imp_compose->redirectMessage(reset($contents));
+        $imp_compose->redirectMessage($contents);
         $get_sig = false;
         $title = _("Redirect");
         $vars->type = 'redirect';
index 5d34108..70d657f 100644 (file)
@@ -219,7 +219,7 @@ class IMP_Ui_Compose
      */
     public function getContents($vars = null)
     {
-        $ob = null;
+        $indices = $ob = null;
 
         if (is_null($vars)) {
             /* IMP: compose.php */
@@ -229,7 +229,7 @@ class IMP_Ui_Compose
             $indices = new IMP_Indices($vars->folder, $vars->uid);
         }
 
-        if (!is_null($ob)) {
+        if (!is_null($indices)) {
             try {
                 $ob = $GLOBALS['injector']->getInstance('IMP_Contents')->getOb($indices);
             } catch (Horde_Exception $e) {}