Merge "Make rmspecials preserve whitespace"

This commit is contained in:
jenkins-bot 2022-02-06 06:22:38 +00:00 committed by Gerrit Code Review
commit 59e2bfcaff
2 changed files with 3 additions and 2 deletions

View file

@ -1170,7 +1170,7 @@ class FilterEvaluator {
* @return array|string
*/
protected function rmspecials( $s ) {
return preg_replace( '/[^\p{L}\p{N}]/u', '', $s );
return preg_replace( '/[^\p{L}\p{N}\s]/u', '', $s );
}
/**

View file

@ -1 +1,2 @@
rmspecials("foo;bar!") === "foobar"
rmspecials("foo;bar!") === "foobar" &
rmspecials("foo; bar!") === "foo bar"