mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Use \h instead of \s in regular expressions"
This commit is contained in:
commit
319789827c
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue