Throw an error when the source and destination pages for mergehistory are the same.
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 21 Sep 2008 17:56:24 +0000 (17:56 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 21 Sep 2008 17:56:24 +0000 (17:56 +0000)
includes/specials/SpecialMergeHistory.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc

index 0460c20..8756c62 100644 (file)
@@ -96,8 +96,10 @@ class MergehistoryForm {
                                wfEscapeWikiText( $this->mDestObj->getPrefixedText() )
                        );
                }
-
-               // TODO: warn about target = dest?
+               
+               if ( $this->mTargetObj->equals( $this->mDestObj ) ) {
+                       $errors[] = wfMsgExt( 'mergehistory-same-destination', array( 'parse' ) );
+               }
 
                if ( count( $errors ) ) {
                        $this->showMergeForm();
index f41083d..84afac3 100644 (file)
@@ -1328,6 +1328,7 @@ Note that using the navigation links will reset this column.',
 'mergehistory-invalid-destination' => 'Destination page must be a valid title.',
 'mergehistory-autocomment'         => 'Merged [[:$1]] into [[:$2]]',
 'mergehistory-comment'             => 'Merged [[:$1]] into [[:$2]]: $3',
+'mergehistory-same-destination'    => 'Source and destination pages cannot be the same',
 
 # Merge log
 'mergelog'           => 'Merge log',
index 9278840..adc31da 100644 (file)
@@ -678,6 +678,7 @@ $wgMessageStructure = array(
                'mergehistory-invalid-destination',
                'mergehistory-autocomment',
                'mergehistory-comment',
+               'mergehistory-same-destination',
        ),
        'mergelog' => array(
                'mergelog',