mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
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:
parent
a038e19fa6
commit
52827acbab
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
rmspecials("foo;bar!") === "foobar"
|
||||
rmspecials("foo;bar!") === "foobar" &
|
||||
rmspecials("foo; bar!") === "foo bar"
|
Loading…
Reference in a new issue