Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -867,7 +867,7 @@ |
868 | 868 | |
869 | 869 | case self::AS_SUCCESS_NEW_ARTICLE: |
870 | 870 | $query = $resultDetails['redirect'] ? 'redirect=no' : ''; |
871 | | - $wgOut->redirect( $this->mTitle->getFullURL( $query ) ); |
| 871 | + $wgOut->redirect( $this->mTitle->getFullURL( $query ) . $resultDetails['sectionanchor'] ); |
872 | 872 | return false; |
873 | 873 | |
874 | 874 | case self::AS_SUCCESS_UPDATE: |
— | — | @@ -1112,8 +1112,17 @@ |
1113 | 1113 | } |
1114 | 1114 | |
1115 | 1115 | $text = $this->textbox1; |
| 1116 | + $result['sectionanchor'] == ''; |
1116 | 1117 | if ( $this->section == 'new' && $this->summary != '' ) { |
1117 | 1118 | $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $text; |
| 1119 | + |
| 1120 | + # Jump to the new section |
| 1121 | + $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->summary ); |
| 1122 | + |
| 1123 | + # This is a new section, so create a link to the new section |
| 1124 | + # in the revision summary. |
| 1125 | + $cleanSummary = $wgParser->stripSectionName( $this->summary ); |
| 1126 | + $this->summary = wfMsgForContent( 'newsectionsummary', $cleanSummary ); |
1118 | 1127 | } |
1119 | 1128 | |
1120 | 1129 | $status->value = self::AS_SUCCESS_NEW_ARTICLE; |