From: daniel Date: Thu, 30 Aug 2012 12:27:40 +0000 (+0200) Subject: Fix for section title when creating new talk page X-Git-Tag: 1.31.0-rc.0~22097^2^2~31^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=99b4430f306a89fecca5c39c66d7388462e71cf6;p=lhc%2Fweb%2Fwiklou.git Fix for section title when creating new talk page Includes some cleanup for WikitextContent::addSectionHeader, etc Change-Id: I61e6ee79d25914c8d7ea9e16ae717dc1f0eba5ac --- diff --git a/includes/Content.php b/includes/Content.php index 8dfcd1c6e0..d2fce059a0 100644 --- a/includes/Content.php +++ b/includes/Content.php @@ -1028,7 +1028,9 @@ class WikitextContent extends TextContent { } if ( $section == 'new' ) { # Inserting a new section if ( $sectionTitle ) { - $subject = wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n"; + $subject = wfMessage( 'newsectionheaderdefaultlevel' ) + ->inContentLanguage()->params( $sectionTitle )->text(); + $subject .= "\n\n"; } else { $subject = ''; } @@ -1058,8 +1060,10 @@ class WikitextContent extends TextContent { * @return Content */ public function addSectionHeader( $header ) { - $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $header ) . "\n\n" . - $this->getNativeData(); + $text = wfMessage( 'newsectionheaderdefaultlevel' ) + ->inContentLanguage()->params( $header )->text(); + $text .= "\n\n"; + $text .= $this->getNativeData(); return new WikitextContent( $text ); } diff --git a/includes/EditPage.php b/includes/EditPage.php index 98b4d4d39f..db00aeb739 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1377,7 +1377,7 @@ class EditPage { } } elseif ( $this->summary !== '' ) { // Insert the section title above the content. - $content = $content->addSectionHeader( $this->sectiontitle ); + $content = $content->addSectionHeader( $this->summary ); // Jump to the new section $result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->summary );