summaryrefslogtreecommitdiff
path: root/includes/parser/DateFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/parser/DateFormatter.php')
-rw-r--r--includes/parser/DateFormatter.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php
index aa6415e4..602bcff3 100644
--- a/includes/parser/DateFormatter.php
+++ b/includes/parser/DateFormatter.php
@@ -48,10 +48,10 @@ class DateFormatter
$this->prxISO2 = '\[\[(-?\d{4})-(\d{2})-(\d{2})\]\]';
# Real regular expressions
- $this->regexes[self::DMY] = "/{$this->prxDM} *,? *{$this->prxY}{$this->regexTrail}";
- $this->regexes[self::YDM] = "/{$this->prxY} *,? *{$this->prxDM}{$this->regexTrail}";
- $this->regexes[self::MDY] = "/{$this->prxMD} *,? *{$this->prxY}{$this->regexTrail}";
- $this->regexes[self::YMD] = "/{$this->prxY} *,? *{$this->prxMD}{$this->regexTrail}";
+ $this->regexes[self::DMY] = "/{$this->prxDM}(?: *, *| +){$this->prxY}{$this->regexTrail}";
+ $this->regexes[self::YDM] = "/{$this->prxY}(?: *, *| +){$this->prxDM}{$this->regexTrail}";
+ $this->regexes[self::MDY] = "/{$this->prxMD}(?: *, *| +){$this->prxY}{$this->regexTrail}";
+ $this->regexes[self::YMD] = "/{$this->prxY}(?: *, *| +){$this->prxMD}{$this->regexTrail}";
$this->regexes[self::DM] = "/{$this->prxDM}{$this->regexTrail}";
$this->regexes[self::MD] = "/{$this->prxMD}{$this->regexTrail}";
$this->regexes[self::ISO1] = "/{$this->prxISO1}{$this->regexTrail}";
@@ -268,7 +268,7 @@ class DateFormatter
$isoDate = implode( '-', $isoBits );;
// Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
- $text = Xml::tags( 'span',
+ $text = Html::rawElement( 'span',
array( 'class' => 'mw-formatted-date', 'title' => $isoDate ), $text );
return $text;