Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -31,6 +31,9 @@ |
32 | 32 | cssText after DOM insertion. |
33 | 33 | * (bug 29102) Upgrades no longer fail with the error "Unknown character set: 'mysql4'. |
34 | 34 | * (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. |
35 | 38 | |
36 | 39 | == MediaWiki 1.18 == |
37 | 40 | 2011-11-24 |
Index: branches/REL1_18/phase3/tests/phpunit/skins/SideBarTest.php |
— | — | @@ -105,8 +105,38 @@ |
106 | 106 | ); |
107 | 107 | |
108 | 108 | } |
| 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 | + ); |
109 | 137 | |
| 138 | + } |
110 | 139 | |
| 140 | + |
111 | 141 | #### Attributes for external links ########################## |
112 | 142 | private function getAttribs( ) { |
113 | 143 | # Sidebar text we will use everytime |
Index: branches/REL1_18/phase3/includes/Skin.php |
— | — | @@ -1258,6 +1258,12 @@ |
1259 | 1259 | if ( strpos( $line, '|' ) !== false ) { // sanity check |
1260 | 1260 | $line = MessageCache::singleton()->transform( $line, false, null, $this->getTitle() ); |
1261 | 1261 | $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 | + |
1262 | 1268 | $extraAttribs = array(); |
1263 | 1269 | |
1264 | 1270 | $msgLink = wfMessage( $line[0] )->inContentLanguage(); |
— | — | @@ -1269,7 +1275,6 @@ |
1270 | 1276 | } else { |
1271 | 1277 | $link = $line[0]; |
1272 | 1278 | } |
1273 | | - |
1274 | 1279 | $msgText = wfMessage( $line[1] ); |
1275 | 1280 | if ( $msgText->exists() ) { |
1276 | 1281 | $text = $msgText->text(); |
Property changes on: branches/REL1_18/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1277 | 1282 | Merged /trunk/phase3/includes:r108145 |
Property changes on: branches/REL1_18/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1278 | 1283 | Merged /trunk/phase3:r108145 |