From: Ævar Arnfjörð Bjarmason Date: Sat, 29 Oct 2005 12:08:48 +0000 (+0000) Subject: * strtolower() => $wgContLang->lc() X-Git-Tag: 1.6.0~1272 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=398af31306a1c33f13b8c9ecee738f4d2b28916f;p=lhc%2Fweb%2Fwiklou.git * strtolower() => $wgContLang->lc() * Merged two loops into one * We're UTF-8 only, always use the /u switch on the regex --- diff --git a/includes/DateFormatter.php b/includes/DateFormatter.php index eee039aa68..7e1e4b683f 100755 --- a/includes/DateFormatter.php +++ b/includes/DateFormatter.php @@ -41,19 +41,12 @@ class DateFormatter $this->monthNames = $this->getMonthRegex(); for ( $i=1; $i<=12; $i++ ) { - $this->xMonths[strtolower( $wgContLang->getMonthName( $i ) )] = $i; - } - for ( $i=1; $i<=12; $i++ ) { - $this->xMonths[strtolower( $wgContLang->getMonthAbbreviation( $i ) )] = $i; - } - - # Attempt at UTF-8 support, untested at the moment - if ( $wgInputEncoding == 'UTF-8' ) { - $this->regexTrail = '(?![a-z])/iu'; - } else { - $this->regexTrail = '(?![a-z])/i'; + $this->xMonths[$wgContLang->lc( $wgContLang->getMonthName( $i ) )] = $i; + $this->xMonths[$wgContLang->lc( $wgContLang->getMonthAbbreviation( $i ) )] = $i; } + $this->regexTrail = '(?![a-z])/iu'; + # Partial regular expressions $this->prxDM = '\[\[(\d{1,2})[ _](' . $this->monthNames . ')]]'; $this->prxMD = '\[\[(' . $this->monthNames . ')[ _](\d{1,2})]]'; @@ -247,7 +240,9 @@ class DateFormatter * @return string ISO month name */ function makeIsoMonth( $monthName ) { - $n = $this->xMonths[strtolower( $monthName )]; + global $wgContLang; + + $n = $this->xMonths[$wgContLang->lc( $monthName )]; return sprintf( '%02d', $n ); }