From c31134c3527bf684842b507ec533bc772865a588 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 23 Oct 2023 09:26:46 +0200 Subject: [PATCH] fix(install): ineffective data fix un upgrade to 2.13.7 --- install/upgrade_to_2.13.7.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/upgrade_to_2.13.7.php b/install/upgrade_to_2.13.7.php index bd2f9ce84..efba230d7 100644 --- a/install/upgrade_to_2.13.7.php +++ b/install/upgrade_to_2.13.7.php @@ -62,7 +62,7 @@ public function fixEncodingInQuestions() { $table = 'glpi_plugin_formcreator_questions'; $result = $DB->request([ - 'SELECT' => 'id', + 'SELECT' => ['id', 'values'], 'FROM' => $table, 'WHERE' => [ 'fieldtype' => ['select', 'multiselect'], @@ -78,7 +78,8 @@ public function fixEncodingInQuestions() { foreach ($values as &$value) { $value = Sanitizer::encodeHtmlSpecialChars($value); } - $values = json_encode($values); + $values = json_encode($values, JSON_UNESCAPED_UNICODE, JSON_UNESCAPED_SLASHES); + $values = $DB->escape($values); $DB->update( $table, ['values' => $values],