r108629 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108628‎ | r108629 | r108630 >
Date:15:44, 11 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Merge r108145, moved RELEASE-NOTES to 1.18
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/Skin.php (modified) (history)
  • /branches/REL1_18/phase3/tests/phpunit/skins/SideBarTest.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -31,6 +31,9 @@
3232 cssText after DOM insertion.
3333 * (bug 29102) Upgrades no longer fail with the error "Unknown character set: 'mysql4'.
3434 * (bug 25355) Parser generates edit section links for special pages.
 35+* (bug 33321) Adding a line to MediaWiki:Sidebar that contains a pipe, but doesn't
 36+ have any pipes after being transformed by MessageCache, causes exception on
 37+ all pages.
3538
3639 == MediaWiki 1.18 ==
3740 2011-11-24
Index: branches/REL1_18/phase3/tests/phpunit/skins/SideBarTest.php
@@ -105,8 +105,38 @@
106106 );
107107
108108 }
 109+ /** bug 33321 */
 110+ function testTrickyPipe() {
 111+ $this->assertSidebar(
 112+ array( 'Title' => array(
 113+ # The first 2 are skipped
 114+ # Doesn't really test the url properly
 115+ # because it will vary with $wgArticlePath et al.
 116+ # ** Baz|Fred
 117+ array(
 118+ 'text' => 'Fred',
 119+ 'href' => Title::newFromText( 'Baz' )->getLocalUrl(),
 120+ 'id' => 'n-Fred',
 121+ 'active' => null,
 122+ ),
 123+ array(
 124+ 'text' => 'title-to-display',
 125+ 'href' => Title::newFromText( 'page-to-go-to' )->getLocalUrl(),
 126+ 'id' => 'n-title-to-display',
 127+ 'active' => null,
 128+ ),
 129+ )),
 130+'* Title
 131+** {{PAGENAME|Foo}}
 132+** Bar
 133+** Baz|Fred
 134+** {{PLURAL:1|page-to-go-to{{int:pipe-separator/en}}title-to-display|branch not taken}}
 135+'
 136+ );
109137
 138+ }
110139
 140+
111141 #### Attributes for external links ##########################
112142 private function getAttribs( ) {
113143 # Sidebar text we will use everytime
Index: branches/REL1_18/phase3/includes/Skin.php
@@ -1258,6 +1258,12 @@
12591259 if ( strpos( $line, '|' ) !== false ) { // sanity check
12601260 $line = MessageCache::singleton()->transform( $line, false, null, $this->getTitle() );
12611261 $line = array_map( 'trim', explode( '|', $line, 2 ) );
 1262+ if ( count( $line ) !== 2 ) {
 1263+ // Second sanity check, could be hit by people doing
 1264+ // funky stuff with parserfuncs... (bug 3321)
 1265+ continue;
 1266+ }
 1267+
12621268 $extraAttribs = array();
12631269
12641270 $msgLink = wfMessage( $line[0] )->inContentLanguage();
@@ -1269,7 +1275,6 @@
12701276 } else {
12711277 $link = $line[0];
12721278 }
1273 -
12741279 $msgText = wfMessage( $line[1] );
12751280 if ( $msgText->exists() ) {
12761281 $text = $msgText->text();
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
12771282 Merged /trunk/phase3/includes:r108145
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
12781283 Merged /trunk/phase3:r108145

Follow-up revisions

RevisionCommit summaryAuthorDate
r108630Remove RELEASE-NOTES-1.19 from r108145, moved to 1.18 in r108629reedy15:45, 11 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108145(bug 33321. Sort of) Adding a line to MediaWiki:Sidebar that contains a pipe,...bawolff15:34, 5 January 2012

Status & tagging log