From 9675702579700124b4309932df6566423ce385ad Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 29 Jan 2014 10:47:58 +0100 Subject: [PATCH] Fix canned responses in HTML mode (#1489536) --- program/js/app.js | 2 +- program/steps/settings/edit_response.inc | 2 +- program/steps/settings/responses.inc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index f4a41e7f4..5887eb6e6 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3396,7 +3396,7 @@ function rcube_webmail() if ($("input[name='_is_html']").val() == '1') { var editor = tinyMCE.get(this.env.composebody); editor.getWin().focus(); // correct focus in IE & Chrome - editor.selection.setContent(insert, { format:'text' }); + editor.selection.setContent(this.quote_html(insert).replace(/\r?\n/g, '
'), { format:'text' }); } // replace selection in compose textarea else { diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc index 760f28290..6d3c3dc41 100644 --- a/program/steps/settings/edit_response.inc +++ b/program/steps/settings/edit_response.inc @@ -35,7 +35,7 @@ if (($key = rcube_utils::get_input_value('_key', rcube_utils::INPUT_GPC))) { // save response if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_RECORD['static']) { $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); - $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true)); if (!empty($name) && !empty($text)) { $dupes = 0; diff --git a/program/steps/settings/responses.inc b/program/steps/settings/responses.inc index 35a2a1b64..06093b3b8 100644 --- a/program/steps/settings/responses.inc +++ b/program/steps/settings/responses.inc @@ -22,7 +22,7 @@ if (!empty($_POST['_insert'])) { $name = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST)); - $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST)); + $text = trim(rcube_utils::get_input_value('_text', rcube_utils::INPUT_POST, true)); if (!empty($name) && !empty($text)) { $dupes = 0;