Fix html parsing on markdown editor

Closes #4243
This commit is contained in:
Rafael de Camargo 2019-07-23 01:26:03 -03:00
parent 97aa9e47e0
commit 21a3634fd1
No known key found for this signature in database
GPG Key ID: B75738DFBA2401F8
3 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ class FormHelper extends Base
}
$html = '<div class="js-text-editor" data-params=\''.json_encode($params, JSON_HEX_APOS).'\'>';
$html .= '<script type="text/template">'.(isset($values[$name]) ? $values[$name] : '').'</script>';
$html .= '<script type="text/template">'.(isset($values[$name]) ? htmlspecialchars($values[$name], ENT_QUOTES, 'UTF-8', true) : '').'</script>';
$html .= '</div>';
$html .= $this->errorList($errors, $name);

File diff suppressed because one or more lines are too long

View File

@ -63,7 +63,7 @@ KB.component('text-editor', function (containerElement, options) {
// Order is important for IE11 (especially for the placeholder)
var textWrapper = KB.dom(containerElement).find('script');
textareaElement.text(textWrapper.innerText);
textareaElement.html(textWrapper.innerHTML);
if (options.placeholder) {
textareaElement.attr('placeholder', options.placeholder);