Skip to content

Commit

Permalink
fix(install): ineffective data fix un upgrade to 2.13.7
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Nov 7, 2023
1 parent 5d0eef6 commit c31134c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions install/upgrade_to_2.13.7.php
Expand Up @@ -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'],
Expand All @@ -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],
Expand Down

0 comments on commit c31134c

Please sign in to comment.