From 24881aa9c08ab9c428686418e8fadaddd915cce6 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 21 Sep 2008 17:56:24 +0000 Subject: [PATCH] Throw an error when the source and destination pages for mergehistory are the same. --- includes/specials/SpecialMergeHistory.php | 6 ++++-- languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialMergeHistory.php b/includes/specials/SpecialMergeHistory.php index 0460c20726..8756c624bd 100644 --- a/includes/specials/SpecialMergeHistory.php +++ b/includes/specials/SpecialMergeHistory.php @@ -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(); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f41083dbeb..84afac3f53 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 9278840340..adc31dad70 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -678,6 +678,7 @@ $wgMessageStructure = array( 'mergehistory-invalid-destination', 'mergehistory-autocomment', 'mergehistory-comment', + 'mergehistory-same-destination', ), 'mergelog' => array( 'mergelog', -- 2.20.1