http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90591
Revision: 90591
Author: ialex
Date: 2011-06-22 17:45:31 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
Removed hidden usage of $wgTitle in parser and the workarround in
ExtraParserTest.php
Modified Paths:
--------------
trunk/phase3/includes/parser/Parser.php
trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
Modified: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php 2011-06-22 16:58:42 UTC (rev
90590)
+++ trunk/phase3/includes/parser/Parser.php 2011-06-22 17:45:31 UTC (rev
90591)
@@ -4383,11 +4383,9 @@
# 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();
}
/**
Modified: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/ExtraParserTest.php 2011-06-22
16:58:42 UTC (rev 90590)
+++ trunk/phase3/tests/phpunit/includes/ExtraParserTest.php 2011-06-22
17:45:31 UTC (rev 90591)
@@ -43,13 +43,11 @@
}
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() {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs