Issue #3143618 by Krzysztof Domański, daffie, longwave, Beakerboy: Replace space (U+0020) with No-Break Space (U+00A0) to minimize false positives
parent
6b769d1e4f
commit
aa97890339
|
@ -726,7 +726,7 @@ abstract class Connection {
|
||||||
// semicolons should only be needed for special cases like defining a
|
// semicolons should only be needed for special cases like defining a
|
||||||
// function or stored procedure in SQL. Trim any trailing delimiter to
|
// function or stored procedure in SQL. Trim any trailing delimiter to
|
||||||
// minimize false positives unless delimiter is allowed.
|
// minimize false positives unless delimiter is allowed.
|
||||||
$trim_chars = " \t\n\r\0\x0B";
|
$trim_chars = " \xA0\t\n\r\0\x0B";
|
||||||
if (empty($options['allow_delimiter_in_query'])) {
|
if (empty($options['allow_delimiter_in_query'])) {
|
||||||
$trim_chars .= ';';
|
$trim_chars .= ';';
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,6 +607,16 @@ class ConnectionTest extends UnitTestCase {
|
||||||
*/
|
*/
|
||||||
public function provideQueriesToTrim() {
|
public function provideQueriesToTrim() {
|
||||||
return [
|
return [
|
||||||
|
'remove_non_breaking_space' => [
|
||||||
|
'SELECT * FROM test',
|
||||||
|
"SELECT * FROM test\xA0",
|
||||||
|
[],
|
||||||
|
],
|
||||||
|
'remove_ordinary_space' => [
|
||||||
|
'SELECT * FROM test',
|
||||||
|
'SELECT * FROM test ',
|
||||||
|
[],
|
||||||
|
],
|
||||||
'remove_semicolon' => [
|
'remove_semicolon' => [
|
||||||
'SELECT * FROM test',
|
'SELECT * FROM test',
|
||||||
'SELECT * FROM test;',
|
'SELECT * FROM test;',
|
||||||
|
|
Loading…
Reference in New Issue