r40919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40918‎ | r40919 | r40920 >
Date:16:55, 16 September 2008
Author:aaron
Status:old
Tags:
Comment:
minor refactoring
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -622,10 +622,12 @@
623623 $this->watchthis = $request->getCheck( 'wpWatchthis' );
624624
625625 # Don't force edit summaries when a user is editing their own user or talk page
626 - if ( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) && $this->mTitle->getText() == $wgUser->getName() ) {
 626+ if ( ( $this->mTitle->mNamespace == NS_USER || $this->mTitle->mNamespace == NS_USER_TALK ) &&
 627+ $this->mTitle->getText() == $wgUser->getName() )
 628+ {
627629 $this->allowBlankSummary = true;
628630 } else {
629 - $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' );
 631+ $this->allowBlankSummary = $request->getBool( 'wpIgnoreBlankSummary' ) || !$wgUser->getOption( 'forceeditsummary');
630632 }
631633
632634 $this->autoSumm = $request->getText( 'wpAutoSummary' );
@@ -950,11 +952,9 @@
951953 }
952954
953955 # Handle the user preference to force summaries here, but not for null edits
954 - if ( $this->section != 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary') &&
955 - 0 != strcmp($oldtext, $text) &&
 956+ if ( $this->section != 'new' && !$this->allowBlankSummary && 0 != strcmp($oldtext, $text) &&
956957 !is_object( Title::newFromRedirect( $text ) ) # check if it's not a redirect
957958 ) {
958 -
959959 if ( md5( $this->summary ) == $this->autoSumm ) {
960960 $this->missingSummary = true;
961961 wfProfileOut( $fname );
@@ -963,7 +963,7 @@
964964 }
965965
966966 # And a similar thing for new sections
967 - if ( $this->section == 'new' && !$this->allowBlankSummary && $wgUser->getOption( 'forceeditsummary' ) ) {
 967+ if ( $this->section == 'new' && !$this->allowBlankSummary ) {
968968 if (trim($this->summary) == '') {
969969 $this->missingSummary = true;
970970 wfProfileOut( $fname );