(bug 8065) Fix summary forcing for new pages
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 Jan 2009 17:47:58 +0000 (17:47 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 Jan 2009 17:47:58 +0000 (17:47 +0000)
includes/EditPage.php

index 154abbc..90af9d2 100644 (file)
@@ -868,6 +868,15 @@ class EditPage {
                                wfProfileOut( $fname );
                                return self::AS_HOOK_ERROR;
                        }
+                       
+                       # Handle the user preference to force summaries here. Check if it's not a redirect.
+                       if ( !$this->allowBlankSummary && !Title::newFromRedirect( $this->textbox1 ) ) {
+                               if ( md5( $this->summary ) == $this->autoSumm ) {
+                                       $this->missingSummary = true;
+                                       wfProfileOut( $fname );
+                                       return self::AS_SUMMARY_NEEDED;
+                               }
+                       }
 
                        $isComment = ( $this->section == 'new' );
 
@@ -949,9 +958,9 @@ class EditPage {
                }
 
                # Handle the user preference to force summaries here, but not for null edits
-               if ( $this->section != 'new' && !$this->allowBlankSummary && 0 != strcmp($oldtext, $text) &&
-                       !is_object( Title::newFromRedirect( $text ) ) # check if it's not a redirect
-               {
+               if ( $this->section != 'new' && !$this->allowBlankSummary && 0 != strcmp($oldtext,$text) 
+                       && !Title::newFromRedirect( $text ) ) # check if it's not a redirect
+               {
                        if ( md5( $this->summary ) == $this->autoSumm ) {
                                $this->missingSummary = true;
                                wfProfileOut( $fname );