r41126 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41125‎ | r41126 | r41127 >
Date:17:56, 21 September 2008
Author:demon
Status:old
Tags:
Comment:
Throw an error when the source and destination pages for mergehistory are the same.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialMergeHistory.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -678,6 +678,7 @@
679679 'mergehistory-invalid-destination',
680680 'mergehistory-autocomment',
681681 'mergehistory-comment',
 682+ 'mergehistory-same-destination',
682683 ),
683684 'mergelog' => array(
684685 'mergelog',
Index: trunk/phase3/includes/specials/SpecialMergeHistory.php
@@ -96,9 +96,11 @@
9797 wfEscapeWikiText( $this->mDestObj->getPrefixedText() )
9898 );
9999 }
 100+
 101+ if ( $this->mTargetObj->equals( $this->mDestObj ) ) {
 102+ $errors[] = wfMsgExt( 'mergehistory-same-destination', array( 'parse' ) );
 103+ }
100104
101 - // TODO: warn about target = dest?
102 -
103105 if ( count( $errors ) ) {
104106 $this->showMergeForm();
105107 $wgOut->addHTML( implode( "\n", $errors ) );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1328,6 +1328,7 @@
13291329 'mergehistory-invalid-destination' => 'Destination page must be a valid title.',
13301330 'mergehistory-autocomment' => 'Merged [[:$1]] into [[:$2]]',
13311331 'mergehistory-comment' => 'Merged [[:$1]] into [[:$2]]: $3',
 1332+'mergehistory-same-destination' => 'Source and destination pages cannot be the same',
13321333
13331334 # Merge log
13341335 'mergelog' => 'Merge log',

Status & tagging log