diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-03-11 16:20:01 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-03-11 16:20:01 +0100 |
commit | abf46755c9638ad27ac876787343fa4c1f0e8990 (patch) | |
tree | 1580fe67d2759f3a697bc6ec6afcc25764c8a789 | |
parent | 336d2000f8b3edd788bbdd49c4c5bc11c895a94d (diff) |
Fix forward as attachment bug with editormode != 1 (#1488991)
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | program/steps/mail/compose.inc | 13 |
2 files changed, 10 insertions, 4 deletions
@@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix forward as attachment bug with editormode != 1 (#1488991) - Fix LIMIT/OFFSET queries handling on MS SQL Server (#1488984) - Fix so task name can really contain all from a-z0-9_- characters (#1488941) - Support IMAP MOVE extension [RFC 6851] diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 25cf63f70..d7cfe7ddd 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -509,7 +509,7 @@ function rcmail_compose_header_from($attrib) function rcmail_compose_editor_mode() { - global $RCMAIL, $MESSAGE, $compose_mode; + global $RCMAIL, $compose_mode; static $useHtml; if ($useHtml !== null) @@ -521,13 +521,13 @@ function rcmail_compose_editor_mode() $useHtml = !empty($_POST['_is_html']); } else if ($compose_mode == RCUBE_COMPOSE_DRAFT || $compose_mode == RCUBE_COMPOSE_EDIT) { - $useHtml = $MESSAGE->has_html_part(false, true); + $useHtml = rcmail_message_is_html(); } else if ($compose_mode == RCUBE_COMPOSE_REPLY) { - $useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false, true))); + $useHtml = ($html_editor == 1 || ($html_editor >= 2 && rcmail_message_is_html())); } else if ($compose_mode == RCUBE_COMPOSE_FORWARD) { - $useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false, true))); + $useHtml = ($html_editor == 1 || ($html_editor == 3 && rcmail_message_is_html())); } else { $useHtml = ($html_editor == 1); @@ -536,6 +536,11 @@ function rcmail_compose_editor_mode() return $useHtml; } +function rcmail_message_is_html() +{ + global $MESSAGE; + return ($MESSAGE instanceof rcube_message) && $MESSAGE->has_html_part(false, true); +} function rcmail_prepare_message_body() { |