Merge "Sanitizer::normalizeWhitespace: simplify redundant preg_replace" into REL1_43

This commit is contained in:
jenkins-bot 2025-03-18 20:22:22 +00:00 committed by Gerrit Code Review
commit 46ac6adf85

View file

@ -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 '';