diff --git a/libraries/classes/Controllers/SqlController.php b/libraries/classes/Controllers/SqlController.php index 64682b2bbd..90897dca69 100644 --- a/libraries/classes/Controllers/SqlController.php +++ b/libraries/classes/Controllers/SqlController.php @@ -269,9 +269,12 @@ class SqlController extends AbstractController return; } + // Converts characters of $curr_value to HTML entities. + $convertedCurrentValue = htmlentities($curr_value, ENT_COMPAT, 'UTF-8'); + $dropdown = $this->template->render('sql/enum_column_dropdown', [ 'values' => $values, - 'selected_values' => [$curr_value], + 'selected_values' => [$convertedCurrentValue], ]); $this->response->addJSON('dropdown', $dropdown); diff --git a/test/classes/Controllers/SqlControllerTest.php b/test/classes/Controllers/SqlControllerTest.php index 01c127a5b9..011cea875e 100644 --- a/test/classes/Controllers/SqlControllerTest.php +++ b/test/classes/Controllers/SqlControllerTest.php @@ -195,7 +195,7 @@ class SqlControllerTest extends AbstractTestCase 'dropdown' => '' . "\n",