# Initialises this object with an ID
function load( $id ) {
- global $wgLang;
+ global $wgContLang;
$this->mId = $id;
- $wgLang->getMagic( $this );
+ $wgContLang->getMagic( $this );
}
/**
$this->mBaseRegex = implode( '|', $escSyn );
$case = $this->mCaseSensitive ? '' : 'i';
$this->mRegex = "/{$this->mBaseRegex}/{$case}";
- $this->mRegexStart = "/^{$this->mBaseRegex}/{$case}";
+ $this->mRegexStart = "/^({$this->mBaseRegex})/{$case}";
$this->mVariableRegex = str_replace( "\\$1", "([$variableClass]*?)", $this->mRegex );
$this->mVariableStartToEndRegex = str_replace( "\\$1", "([$variableClass]*?)",
"/^({$this->mBaseRegex})$/{$case}" );
$matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches );
if ( $matchcount == 0 ) {
return NULL;
- } elseif ( count($matches) == 1 ) {
+ } elseif ( count($matches) == 2 ) {
return $matches[0];
} else {
- return $matches[1];
+ return $matches[2];
}
}