r75250 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75249‎ | r75250 | r75251 >
Date:15:32, 23 October 2010
Author:demon
Status:ok
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/tests/phpunit/includes/TitleTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/phpunit/includes/TitleTest.php
@@ -1,10 +1,6 @@
22 <?php
33
44 class TitleTest extends PHPUnit_Framework_TestCase {
5 - function setUp() {
6 - global $wgContLang;
7 - $wgContLang = Language::factory( 'en' );
8 - }
95
106 function testLegalChars() {
117 $titlechars = Title::legalChars();
@@ -18,23 +14,4 @@
1915 }
2016 }
2117 }
22 -
23 - /**
24 - * Test originally wrote to investigate bug 24343
25 - */
26 - function testGetURLS() {
27 - global $wgArticlePath;
28 -
29 - $title = Title::newFromText( 'User:Bob#section' );
30 -
31 - $this->assertEquals( str_replace( '$1', 'User:Bob', $wgArticlePath ), $title->getLocalURL(),
32 - 'Title::getLocalURL() does NOT have fragment' );
33 - $this->assertEquals( str_replace( '$1', 'User:Bob', $wgArticlePath ), $title->escapeLocalURL(),
34 - 'Title::escapeLocalURL() does NOT have fragment' );
35 - $this->assertEquals( str_replace( '$1', 'User:Bob#section', $wgArticlePath ), $title->getLinkURL(),
36 - 'Title::getLinkURL() does have fragment' );
37 -
38 - #$this->assertEquals( 'toto', $title->getFullURL() );
39 - #$this->assertEquals( 'toto', $title->escapeFullURL() );
40 - }
4118 }
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -31,7 +31,6 @@
3232 $parser->setFunctionHook( 'localurle', array( __CLASS__, 'localurle' ), SFH_NO_HASH );
3333 $parser->setFunctionHook( 'fullurl', array( __CLASS__, 'fullurl' ), SFH_NO_HASH );
3434 $parser->setFunctionHook( 'fullurle', array( __CLASS__, 'fullurle' ), SFH_NO_HASH );
35 - $parser->setFunctionHook( 'linkurl', array( __CLASS__, 'linkurl' ), SFH_NO_HASH );
3635 $parser->setFunctionHook( 'formatnum', array( __CLASS__, 'formatnum' ), SFH_NO_HASH );
3736 $parser->setFunctionHook( 'grammar', array( __CLASS__, 'grammar' ), SFH_NO_HASH );
3837 $parser->setFunctionHook( 'gender', array( __CLASS__, 'gender' ), SFH_NO_HASH );
@@ -195,7 +194,6 @@
196195 static function localurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeLocalURL', $s, $arg ); }
197196 static function fullurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getFullURL', $s, $arg ); }
198197 static function fullurle( $parser, $s = '', $arg = null ) { return self::urlFunction( 'escapeFullURL', $s, $arg ); }
199 - static function linkurl( $parser, $s = '', $arg = null ) { return self::urlFunction( 'getLinkUrl', $s, $arg ); }
200198
201199 static function urlFunction( $func, $s = '', $arg = null ) {
202200 $title = Title::newFromText( $s );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -295,7 +295,6 @@
296296 'nse' => array( 0, 'NSE:' ),
297297 'localurl' => array( 0, 'LOCALURL:' ),
298298 'localurle' => array( 0, 'LOCALURLE:' ),
299 - 'linkurl' => array( 0, 'LINKURL:' ),
300299 'articlepath' => array( 0, 'ARTICLEPATH' ),
301300 'server' => array( 0, 'SERVER' ),
302301 'servername' => array( 0, 'SERVERNAME' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -176,7 +176,6 @@
177177 limit for IP addresses: [[MediaWiki:Ratelimit-excluded-ips]]
178178 * Special:Version now displays whether a SQLite database supports full-text
179179 search.
180 -* (bug 24343) New parser hook {{linkurl:}}, same as {{localurl:}} with fragment
181180 * TS_ISO_8691_BASIC was added as a time format, which is used by ResourceLoader
182181 for versioning
183182 * Maintenance scripts get a --memory-limit option to override defaults (which

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r73976Implements bug 24343 "localurl discards section id"....hashar19:51, 29 September 2010

Status & tagging log