# Temporary
# These are variables reset at least once per parse regardless of $clearState
- var $mOptions; # ParserOptions object
+
+ /**
+ * @var ParserOptions
+ */
+ var $mOptions;
var $mTitle; # Title context, used for self-link rendering and similar things
var $mOutputType; # Output type, one of the OT_xxx constants
var $ot; # Shortcut alias, see setOutputType()
return $this->mLinkID++;
}
+ /**
+ * @return Language
+ */
function getFunctionLang() {
global $wgLang, $wgContLang;
}
if ( $stack > 0 ) {
wfDebug( __METHOD__.": Invalid input; not enough close tags (stack $stack, state $state)\n" );
+ wfProfileOut( __METHOD__ );
return false;
}
wfProfileOut( __METHOD__ );
*
* @param $text String: the text to preprocess
* @param $options ParserOptions: options
+ * @param $title Title object or null to use $wgTitle
* @return String
*/
- public function transformMsg( $text, $options ) {
- global $wgTitle;
+ public function transformMsg( $text, $options, $title = null ) {
static $executing = false;
# Guard against infinite recursion
$executing = true;
wfProfileIn( __METHOD__ );
- $title = $wgTitle;
+ if ( !$title ) {
+ global $wgTitle;
+ $title = $wgTitle;
+ }
if ( !$title ) {
# It's not uncommon having a null $wgTitle in scripts. See r80898
# Create a ghost title in such case