# If we're still here, make it a link to the user page
$userText = wfEscapeWikiText( $username );
$nickText = wfEscapeWikiText( $nickname );
- if ( $user->isAnon() ) {
- return wfMsgExt( 'signature-anon', array( 'content', 'parsemag' ), $userText, $nickText );
- } else {
- return wfMsgExt( 'signature', array( 'content', 'parsemag' ), $userText, $nickText );
- }
+ $msgName = $user->isAnon() ? 'signature-anon' : 'signature';
+
+ return wfMessage( $msgName, $userText, $nickText )->inContentLanguage()->title( $this->getTitle() )->text();
}
/**
}
function testPreSaveTransform() {
- global $wgUser, $wgTitle;
+ global $wgUser;
$title = Title::newFromText( __FUNCTION__ );
- $oldTitle = $wgTitle; $wgTitle = $title; # Used by transformMsg()
$outputText = $this->parser->preSaveTransform( "Test\r\n{{subst:Foo}}\n{{Bar}}", $title, $wgUser, $this->options );
$this->assertEquals( "Test\nContent of ''Template:Foo''\n{{Bar}}", $outputText );
- $wgTitle = $oldTitle;
}
function testPreprocess() {