Index: trunk/phase3/includes/Parser.php |
— | — | @@ -3212,14 +3212,25 @@ |
3213 | 3213 | # replace ==section headers== |
3214 | 3214 | # XXX this needs to go away once we have a better parser. |
3215 | 3215 | if ( !$this->ot['wiki'] && !$this->ot['pre'] && $replaceHeadings ) { |
3216 | | - if( !is_null( $title ) ) |
3217 | | - $encodedname = base64_encode($title->getPrefixedDBkey()); |
| 3216 | + if( !is_null( $title ) ) { |
| 3217 | + |
| 3218 | + #Follow redirects |
| 3219 | + $redirect = new Article($title); |
| 3220 | + $redirect = $redirect->followRedirect(); |
| 3221 | + if( ! ($redirect instanceof Title)) |
| 3222 | + $redirect = $title; |
| 3223 | + |
| 3224 | + |
| 3225 | + $encodedname = base64_encode($redirect->getPrefixedDBkey()); |
| 3226 | + } |
| 3227 | + |
3218 | 3228 | else |
3219 | 3229 | $encodedname = base64_encode(""); |
3220 | 3230 | $m = preg_split('/(^={1,6}.*?={1,6}\s*?$)/m', $text, -1, |
3221 | 3231 | PREG_SPLIT_DELIM_CAPTURE); |
3222 | 3232 | $text = ''; |
3223 | 3233 | $nsec = $headingOffset; |
| 3234 | + |
3224 | 3235 | for( $i = 0; $i < count($m); $i += 2 ) { |
3225 | 3236 | $text .= $m[$i]; |
3226 | 3237 | if (!isset($m[$i + 1]) || $m[$i + 1] == "") continue; |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -1497,7 +1497,7 @@ |
1498 | 1498 | $wgOut->setArticleRelated( false ); |
1499 | 1499 | |
1500 | 1500 | $wgOut->addWikiText( wfMsg( 'nosuchsectiontext', $this->section ) ); |
1501 | | - $wgOut->returnToMain( false ); |
| 1501 | + $wgOut->returnToMain( false, $this->mTitle->getPrefixedUrl() ); |
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | /** |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -373,7 +373,7 @@ |
374 | 374 | * (bug 7629) Fix $wgBrowserBlackList to avoid false positive on MSIE |
375 | 375 | when certain plugins are present which alter the user agent |
376 | 376 | * (bug 9712) Use Arabic comma in date/time formats for Arabic and Farsi |
377 | | - |
| 377 | +* (bug 9670) Follow redirects when render edit section links to transcluded templates. |
378 | 378 | == Maintenance == |
379 | 379 | |
380 | 380 | * New script maintenance/language/checkExtensioni18n.php used to check i18n |