diff options
Diffstat (limited to 'program/steps/mail/compose.inc')
-rw-r--r-- | program/steps/mail/compose.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 646d2bcd1..f75b219ff 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -110,9 +110,10 @@ $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubj 'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany', 'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save', - 'savingresponse'); + 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore'); $OUTPUT->set_env('compose_id', $COMPOSE['id']); +$OUTPUT->set_env('session_id', session_id()); $OUTPUT->set_pagetitle(rcube_label('compose')); // add config parameters to client script @@ -239,6 +240,9 @@ if (!empty($msg_uid) && empty($COMPOSE['as_attachment'])) $COMPOSE['reply_msgid'] = '<' . $in_reply_to . '>'; $COMPOSE['references'] = $MESSAGE->headers->references; + + // use message-ID as draft_id, same as in sendmail.inc + $OUTPUT->set_env('draft_id', trim($MESSAGE->headers->get('message-id'), '<>')); } } else { @@ -442,6 +446,11 @@ function rcmail_process_compose_params(&$COMPOSE) } } + // clean HTML message body which can be submitted by URL + if ($COMPOSE['param']['body']) { + $COMPOSE['param']['body'] = rcmail_wash_html($COMPOSE['param']['body'], array('safe' => false, 'inline_html' => true), array()); + } + $RCMAIL = rcmail::get_instance(); // select folder where to save the sent message @@ -642,7 +651,7 @@ function rcmail_prepare_message_body() } else if ($COMPOSE['param']['body']) { $body = $COMPOSE['param']['body']; - $isHtml = false; + $isHtml = (bool) $COMPOSE['param']['html']; } // forward as attachment else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) { @@ -827,6 +836,9 @@ function rcmail_compose_body($attrib) $msgtype = new html_hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0"))); $out .= $msgtype->show(); + $framed = new html_hiddenfield(array('name' => '_framed', 'value' => '1')); + $out .= $framed->show(); + // If desired, set this textarea to be editable by TinyMCE if ($isHtml) { $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET); |