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

@ -86,10 +86,15 @@ class HtmlArea extends Etemplate\Widget
if (!$this->is_readonly($cname, $form_name))
{
$value = Api\Html\HtmLawed::purify(
self::get_array($content, $form_name),
$this->attrs['validation_rules']
);
$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(
self::get_array($content, $form_name),
$this->attrs['validation_rules']
);
}
$valid =& self::get_array($validated, $form_name, true);
if (true) $valid = $value;
}