diff --git a/includes/DiscussionParser.php b/includes/DiscussionParser.php index af17266e0..4a5e20ebe 100644 --- a/includes/DiscussionParser.php +++ b/includes/DiscussionParser.php @@ -3,7 +3,7 @@ use MediaWiki\MediaWikiServices; abstract class EchoDiscussionParser { - const HEADER_REGEX = '^(==+)\s*([^=].*)\s*\1$'; + const HEADER_REGEX = '^(==+)\h*([^=].*)\h*\1$'; static protected $timestampRegex; static protected $revisionInterpretationCache = []; @@ -1144,7 +1144,7 @@ abstract class EchoDiscussionParser { // Step 2: Generalise it // Trim off the timezone to replace at the end $output = $exemplarTimestamp; - $tzRegex = '/\s*\(\w+\)\s*$/'; + $tzRegex = '/\h*\(\w+\)\h*$/'; $tzMatches = []; if ( preg_match( $tzRegex, $output, $tzMatches ) ) { $output = preg_replace( $tzRegex, '', $output );