]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blobdiff - includes/parser/DateFormatter.php
MediaWiki 1.16.0
[autoinstalls/mediawiki.git] / includes / parser / DateFormatter.php
index aa6415e47aedb52ccf29fa7e594ebf329a9ec2f9..602bcff370f43b2c8ff14203bebbf7a2742d4806 100644 (file)
@@ -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;