Skip to content

Commit 525cfd5

Browse files
committed
fix(textarea): encoding problem when picture is embedded
target ticket shows not interpreted HTML tags, due to bad escaping
1 parent e74f30e commit 525cfd5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inc/field/textareafield.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Html;
3838
use Session;
3939
use Toolbox;
40+
use Glpi\Toolbox\Sanitizer;
4041
use Glpi\RichText\RichText;
4142
use Glpi\Application\View\TemplateRenderer;
4243

@@ -128,12 +129,12 @@ public function serializeValue(): string {
128129
]
129130
);
130131
$this->value = $input[$key];
131-
$this->value = Html::entity_decode_deep($this->value);
132+
$this->value = Sanitizer::unsanitize($this->value);
132133
foreach ($input['_tag'] as $tag) {
133134
$regex = '/<img[^>]+' . preg_quote($tag, '/') . '[^<]+>/im';
134135
$this->value = preg_replace($regex, "#$tag#", $this->value);
135136
}
136-
$this->value = Html::entities_deep($this->value);
137+
$this->value = Sanitizer::sanitize($this->value);
137138
}
138139

139140
return $this->value;

0 commit comments

Comments
 (0)