From da9d8dca8929d20830be9fca62fa07a7b7b7b07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Mon, 7 Nov 2022 09:11:30 +0100 Subject: [PATCH] fix(textfield): remove invalid '\r\n' tokens (#3065) --- inc/field/textfield.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/field/textfield.class.php b/inc/field/textfield.class.php index 08d7250af..159a12b08 100644 --- a/inc/field/textfield.class.php +++ b/inc/field/textfield.class.php @@ -226,6 +226,10 @@ public function parseAnswerValues($input, $nonDestructive = false): bool { return false; } + if (version_compare(GLPI_VERSION, '9.5.10', '>=')) { + $input[$key] = str_replace('\r\n', "\r\n", $input[$key]); + } + $this->value = Toolbox::stripslashes_deep($input[$key]); return true; }