From: Chad Horohoe Date: Sat, 23 Oct 2010 15:32:31 +0000 (+0000) Subject: Revert r73976 (Implements bug 24343 "localurl discards section id"). Per BZ feedback... X-Git-Tag: 1.31.0-rc.0~34368 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=ba134fca3aa58364357715071ccbf74d9efeb2b2;p=lhc%2Fweb%2Fwiklou.git Revert r73976 (Implements bug 24343 "localurl discards section id"). Per BZ feedback, this doesn't actually fix the original issue, it adds a new parser function to work around the issue. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c89ede5bc3..62128cbb13 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -176,7 +176,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN limit for IP addresses: [[MediaWiki:Ratelimit-excluded-ips]] * Special:Version now displays whether a SQLite database supports full-text search. -* (bug 24343) New parser hook {{linkurl:}}, same as {{localurl:}} with fragment * TS_ISO_8691_BASIC was added as a time format, which is used by ResourceLoader for versioning * Maintenance scripts get a --memory-limit option to override defaults (which diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index bf36ea7176..94949221df 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -31,7 +31,6 @@ class CoreParserFunctions { $parser->setFunctionHook( 'localurle', array( __CLASS__, 'localurle' ), SFH_NO_HASH ); $parser->setFunctionHook( 'fullurl', array( __CLASS__, 'fullurl' ), SFH_NO_HASH ); $parser->setFunctionHook( 'fullurle', array( __CLASS__, 'fullurle' ), SFH_NO_HASH ); - $parser->setFunctionHook( 'linkurl', array( __CLASS__, 'linkurl' ), SFH_NO_HASH ); $parser->setFunctionHook( 'formatnum', array( __CLASS__, 'formatnum' ), SFH_NO_HASH ); $parser->setFunctionHook( 'grammar', array( __CLASS__, 'grammar' ), SFH_NO_HASH ); $parser->setFunctionHook( 'gender', array( __CLASS__, 'gender' ), SFH_NO_HASH ); @@ -195,7 +194,6 @@ class CoreParserFunctions { static function localurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeLocalURL', $s, $arg ); } static function fullurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getFullURL', $s, $arg ); } static function fullurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeFullURL', $s, $arg ); } - static function linkurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getLinkUrl', $s, $arg ); } static function urlFunction( $func, $s = '', $arg = null ) { $title = Title::newFromText( $s ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 1cfb4261f4..c9d45f61fd 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -295,7 +295,6 @@ $magicWords = array( 'nse' => array( 0, 'NSE:' ), 'localurl' => array( 0, 'LOCALURL:' ), 'localurle' => array( 0, 'LOCALURLE:' ), - 'linkurl' => array( 0, 'LINKURL:' ), 'articlepath' => array( 0, 'ARTICLEPATH' ), 'server' => array( 0, 'SERVER' ), 'servername' => array( 0, 'SERVERNAME' ), diff --git a/maintenance/tests/phpunit/includes/TitleTest.php b/maintenance/tests/phpunit/includes/TitleTest.php index cef47a9fa1..5b42c1c575 100644 --- a/maintenance/tests/phpunit/includes/TitleTest.php +++ b/maintenance/tests/phpunit/includes/TitleTest.php @@ -1,10 +1,6 @@ assertEquals( str_replace( '$1', 'User:Bob', $wgArticlePath ), $title->getLocalURL(), - 'Title::getLocalURL() does NOT have fragment' ); - $this->assertEquals( str_replace( '$1', 'User:Bob', $wgArticlePath ), $title->escapeLocalURL(), - 'Title::escapeLocalURL() does NOT have fragment' ); - $this->assertEquals( str_replace( '$1', 'User:Bob#section', $wgArticlePath ), $title->getLinkURL(), - 'Title::getLinkURL() does have fragment' ); - - #$this->assertEquals( 'toto', $title->getFullURL() ); - #$this->assertEquals( 'toto', $title->escapeFullURL() ); - } }