From 3524b174846d970eaa0dac702db9c1bdc181fffb Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Sat, 28 Feb 2015 10:38:04 +1100 Subject: [PATCH] Fixes #973 - Double encode HTML entities in CodeEditor value --- modules/backend/formwidgets/CodeEditor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/backend/formwidgets/CodeEditor.php b/modules/backend/formwidgets/CodeEditor.php index b4578a250..ded2567c0 100644 --- a/modules/backend/formwidgets/CodeEditor.php +++ b/modules/backend/formwidgets/CodeEditor.php @@ -119,7 +119,9 @@ class CodeEditor extends FormWidgetBase $this->vars['stretch'] = $this->formField->stretch; $this->vars['size'] = $this->formField->size; $this->vars['name'] = $this->formField->getName(); - $this->vars['value'] = $this->getLoadValue(); + + // Double encode when escaping + $this->vars['value'] = htmlentities($this->getLoadValue(), ENT_QUOTES, 'UTF-8', true); } /**