Make rmspecials preserve whitespace

The existing filters on WMF wikis has been changes such that calls
to rmspecials() are now rmspecials(rmwhitespace()) to ensure no change
is made in behaviour. Filter admins can change this back if filter is
not meant to trigger when part of the input is contains spaces.

Bug: T263024
Change-Id: Idde09b50fb8eda357afbedc1199a5483fa8217c1
This commit is contained in:
Huji 2022-02-02 02:07:56 +00:00 committed by Krinkle
parent a038e19fa6
commit 52827acbab
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"