global $wgContLang, $wgMainCacheType;
$lang = $lang ? wfGetLangObj( $lang ) : $wgContLang;
global $wgContLang, $wgMainCacheType;
$lang = $lang ? wfGetLangObj( $lang ) : $wgContLang;
static $dateFormatter = false;
if ( !$dateFormatter ) {
$dateFormatter = $cache->getWithSetCallback(
$cache->makeKey( 'dateformatter', $lang->getCode() ),
static $dateFormatter = false;
if ( !$dateFormatter ) {
$dateFormatter = $cache->getWithSetCallback(
$cache->makeKey( 'dateformatter', $lang->getCode() ),
$linked = in_array( 'linked', $options );
$match_whole = in_array( 'match-whole', $options );
$linked = in_array( 'linked', $options );
$match_whole = in_array( 'match-whole', $options );
- $regex = str_replace( array( '\[\[', '\]\]' ), '', $regex );
+ $regex = str_replace( [ '\[\[', '\]\]' ], '', $regex );
- $text = preg_replace_callback( $regex, array( &$this, 'replace' ), $text );
+ $text = preg_replace_callback( $regex, [ &$this, 'replace' ], $text );
$key = $this->keys[$this->mSource];
$keyLength = strlen( $key );
for ( $p = 0; $p < $keyLength; $p++ ) {
$key = $this->keys[$this->mSource];
$keyLength = strlen( $key );
for ( $p = 0; $p < $keyLength; $p++ ) {
- $format = str_replace( array( '[[', ']]' ), '', $format );
+ $format = str_replace( [ '[[', ']]' ], '', $format );
// Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
$text = Html::rawElement( 'span',
// Output is not strictly HTML (it's wikitext), but <span> is whitelisted.
$text = Html::rawElement( 'span',
for ( $i = 1; $i <= 12; $i++ ) {
$names[] = $this->lang->getMonthName( $i );
$names[] = $this->lang->getMonthAbbreviation( $i );
for ( $i = 1; $i <= 12; $i++ ) {
$names[] = $this->lang->getMonthName( $i );
$names[] = $this->lang->getMonthAbbreviation( $i );