diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 156bc5f0aea..b3c6d1ab563 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -146,6 +146,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Allow case-sensitive URLs to be used for uploading from URLs. * (bug 1109) Correct fix for compressed 304 responses when additional output buffers have been installed within the compression handler +* (bug 7819) Move automatic redirect edit summary after pre-save transform + to work properly with subst: fun == Languages updated == diff --git a/includes/Article.php b/includes/Article.php index c3ef0fb74a9..b2c3b7efd59 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1272,6 +1272,14 @@ class Article { $isminor = ( $flags & EDIT_MINOR ) && $wgUser->isAllowed('minoredit'); $bot = $wgUser->isAllowed( 'bot' ) || ( $flags & EDIT_FORCE_BOT ); + # If no edit comment was given when creating a new page, and what's being + # created is a redirect, be smart and fill in a neat auto-comment + if( $summary == '' ) { + $rt = Title::newFromRedirect( $text ); + if( is_object( $rt ) ) + $summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() ); + } + $text = $this->preSaveTransform( $text ); $dbw =& wfGetDB( DB_MASTER ); diff --git a/includes/EditPage.php b/includes/EditPage.php index 96e86773688..5a3e67c20a3 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -652,14 +652,6 @@ class EditPage { return false; } - # If no edit comment was given when creating a new page, and what's being - # created is a redirect, be smart and fill in a neat auto-comment - if( $this->summary == '' ) { - $rt = Title::newFromRedirect( $this->textbox1 ); - if( is_object( $rt ) ) - $this->summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() ); - } - $isComment=($this->section=='new'); $this->mArticle->insertNewArticle( $this->textbox1, $this->summary, $this->minoredit, $this->watchthis, false, $isComment); @@ -731,14 +723,6 @@ class EditPage { return true; } - # If no edit comment was given when turning a page into a redirect, be smart - # and fill in a neat auto-comment - if( $this->summary == '' ) { - $rt = Title::newFromRedirect( $this->textbox1 ); - if( is_object( $rt ) ) - $this->summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() ); - } - # Handle the user preference to force summaries here if( $this->section != 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) { if( md5( $this->summary ) == $this->autoSumm ) {