Take ascii mode into account before purifying the value

This commit is contained in:
Hadi Nategh 2019-02-28 11:47:00 +01:00
parent 3a904b16bd
commit 09e90b1235

View File

@ -85,11 +85,16 @@ class HtmlArea extends Etemplate\Widget
$form_name = self::form_name($cname, $this->id, $expand); $form_name = self::form_name($cname, $this->id, $expand);
if (!$this->is_readonly($cname, $form_name)) if (!$this->is_readonly($cname, $form_name))
{
$value = self::get_array($content, $form_name);
// only purify for html, mode "ascii" is NO html and content get lost!
if ($this->attrs['mode'] != 'ascii')
{ {
$value = Api\Html\HtmLawed::purify( $value = Api\Html\HtmLawed::purify(
self::get_array($content, $form_name), self::get_array($content, $form_name),
$this->attrs['validation_rules'] $this->attrs['validation_rules']
); );
}
$valid =& self::get_array($validated, $form_name, true); $valid =& self::get_array($validated, $form_name, true);
if (true) $valid = $value; if (true) $valid = $value;
} }