From: Chad Horohoe Date: Sun, 21 Sep 2008 17:56:24 +0000 (+0000) Subject: Throw an error when the source and destination pages for mergehistory are the same. X-Git-Tag: 1.31.0-rc.0~45161 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=24881aa9c08ab9c428686418e8fadaddd915cce6;p=lhc%2Fweb%2Fwiklou.git Throw an error when the source and destination pages for mergehistory are the same. --- 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',