Skip to content

Commit 5b6bc51

Browse files
committed
fix(textareafield): update escaping / line ending conversion to match GLPI 10
1 parent 7de8b01 commit 5b6bc51

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

inc/field/textareafield.class.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class TextareaField extends TextField
5252

5353
public function showForm(array $options): void {
5454
$template = '@formcreator/field/' . $this->question->fields['fieldtype'] . 'field.html.twig';
55-
$this->question->fields['default_values'] = Html::entities_deep($this->question->fields['default_values']);
5655
$this->deserializeValue($this->question->fields['default_values']);
5756
$parameters = $this->getParameters();
5857
TemplateRenderer::getInstance()->display($template, [
@@ -71,7 +70,7 @@ public function getRenderedHtml($domain, $canEdit = true): string {
7170
$id = $this->question->getID();
7271
$rand = mt_rand();
7372
$fieldName = 'formcreator_field_' . $id;
74-
$value = nl2br(__($this->value, $domain));
73+
$value = $this->value;
7574
$html = '';
7675
$html .= Html::textarea([
7776
'name' => $fieldName,
@@ -183,7 +182,6 @@ public function prepareQuestionInputForSave($input): array {
183182
if (!$success) {
184183
return [];
185184
}
186-
$this->value = Toolbox::stripslashes_deep(str_replace('\r\n', "\r\n", $input['default_values']));
187185

188186
// Handle uploads
189187
$key = 'formcreator_field_' . $this->question->getID();

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,4 +474,4 @@ function plugin_formcreator_redirect() {
474474
Html::redirect($issue->getFormURLWithID($issue->getID()) . '&tickets_id=' . $itemTicket->fields['tickets_id']);
475475
}
476476
}
477-
}
477+
}

0 commit comments

Comments
 (0)