diff --git a/api/js/etemplate/et2_widget_htmlarea.ts b/api/js/etemplate/et2_widget_htmlarea.ts index a77e7cf625..187800942f 100644 --- a/api/js/etemplate/et2_widget_htmlarea.ts +++ b/api/js/etemplate/et2_widget_htmlarea.ts @@ -267,7 +267,8 @@ export class et2_htmlarea extends et2_editableWidget implements et2_IResizeable "visualblocks visualchars image link media template fullscreen", "codesample table charmap hr pagebreak nonbreaking anchor toc ", "insertdatetime advlist lists textcolor wordcount imagetools ", - "colorpicker textpattern help paste code searchreplace tabfocus" + "colorpicker textpattern help paste code searchreplace tabfocus", + "noneditable" ], toolbar: et2_htmlarea.TOOLBAR_SIMPLE, block_formats: "Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;"+ diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 4f53d313f8..b004b41082 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1400,6 +1400,12 @@ class mail_compose // set filemode icons for all attachments if(!empty($content['attachments'])) { + // Make sure placeholder is there + $attachment_block = '
Download attachments' . lang('Attachments') . '
'; + if($content['is_html'] && strpos($content['mail_htmltext'], $attachment_block) == false) + { + $content['mail_htmltext'] .= $attachment_block; + } foreach($content['attachments'] as &$attach) { $attach['is_dir'] = !empty($attach['file']) && is_dir($attach['file']); @@ -2567,13 +2573,13 @@ class mail_compose case 'html': $body = $_formData['body']; - static $ruler = '
]*>#', $attachment_links, $body); + $body = preg_replace('#' . $attachment_block . '[^>]*>.*#', $attachment_links, $body); } // else place it before the signature elseif (strpos($body, '') !== false) @@ -2585,6 +2591,7 @@ class mail_compose $body .= $attachment_links; } } + static $ruler = '