diff --git a/htdocs/core/db/DoliDB.class.php b/htdocs/core/db/DoliDB.class.php index 3a2346c2356..1caa8d6dcdf 100644 --- a/htdocs/core/db/DoliDB.class.php +++ b/htdocs/core/db/DoliDB.class.php @@ -186,8 +186,8 @@ abstract class DoliDB implements Database */ public function sanitize($stringtosanitize, $allowsimplequote = 0, $allowsequals = 0, $allowsspace = 0, $allowschars = 1) { - //$result = preg_replace('/[^0-9_\-\.,'.($allowschars ? '\p{L}' : '').($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').($allowsspace ? ' ' : '').']/ui', '', $stringtosanitize); - $result = preg_replace('/[^0-9_\-\.,'.($allowschars ? 'a-z' : '').($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').($allowsspace ? ' ' : '').']/i', '', $stringtosanitize); + $result = preg_replace('/[^0-9_\-\.,'.($allowschars ? '\p{L}' : '').($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').($allowsspace ? ' ' : '').']/ui', '', $stringtosanitize); + //$result = preg_replace('/[^0-9_\-\.,'.($allowschars ? 'a-z' : '').($allowsequals ? '=' : '').($allowsimplequote ? "\'" : '').($allowsspace ? ' ' : '').']/i', '', $stringtosanitize); if ($allowsimplequote == 1) { // Remove all quotes that are inside a string and not around diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 7f585eed557..67c3e13b816 100644 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -1954,7 +1954,7 @@ class FunctionsLibTest extends CommonClassTest var_dump($s); */ - //$s = natural_search("t.field", "KØB", 3); // mode 3 is to provide a list of string separated with coma - //$this->assertEquals(" AND (t.field IN ('KØB'))", $s); + $s = natural_search("t.field", "KØB", 3); // mode 3 is to provide a list of string separated with coma + $this->assertEquals(" AND (t.field IN ('KØB'))", $s); } }