diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php index 9a487d8e52..b7d1e34acd 100644 --- a/core/lib/Drupal/Core/Database/Connection.php +++ b/core/lib/Drupal/Core/Database/Connection.php @@ -726,9 +726,8 @@ public function query($query, array $args = [], $options = []) { // statement at a time. Thus, the presence of a SQL delimiter (the // semicolon) is not allowed unless the option is set. Allowing // semicolons should only be needed for special cases like defining a - // function or stored procedure in SQL. Trim any trailing delimiter - // (including non-breaking space) to minimize false positives unless - // delimiter is allowed. + // function or stored procedure in SQL. Trim any trailing delimiter to + // minimize false positives unless delimiter is allowed. $trim_chars = " \xA0\t\n\r\0\x0B"; if (empty($options['allow_delimiter_in_query'])) { $trim_chars .= ';'; diff --git a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php index a51047b3e1..d5a2dec316 100644 --- a/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php +++ b/core/tests/Drupal/Tests/Core/Database/ConnectionTest.php @@ -609,7 +609,7 @@ public function provideQueriesToTrim() { return [ 'remove_non_breaking_space' => [ 'SELECT * FROM test', - 'SELECT * FROM test\xA0', + "SELECT * FROM test\xA0", [], ], 'remove_ordinary_space' => [