Merge "Sanitizer::normalizeWhitespace: simplify redundant preg_replace" into REL1_43
This commit is contained in:
commit
46ac6adf85
1 changed files with 1 additions and 1 deletions
|
|
@ -1136,7 +1136,7 @@ class Sanitizer {
|
|||
}
|
||||
|
||||
private static function normalizeWhitespace( string $text ): string {
|
||||
$normalized = preg_replace( '/(?:\r\n|[\x20\x0d\x0a\x09])+/', ' ', $text );
|
||||
$normalized = preg_replace( '/[ \r\n\t]+/', ' ', $text );
|
||||
if ( $normalized === null ) {
|
||||
wfLogWarning( __METHOD__ . ': Failed to normalize whitespace: ' . preg_last_error() );
|
||||
return '';
|
||||
|
|
|
|||
Loading…
Reference in a new issue