From: Tim Starling Date: Fri, 6 Jan 2006 12:50:37 +0000 (+0000) Subject: Prevent accidental deletion during page move. X-Git-Tag: 1.6.0~749 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=ac563af7e7489e701b6b68756fb7b10ed058d07d;p=lhc%2Fweb%2Fwiklou.git Prevent accidental deletion during page move. --- diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 3c9d326892..746f5714eb 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -50,7 +50,7 @@ class MovePageForm { $this->newTitle = $wgRequest->getText( 'wpNewTitle' ); $this->reason = $wgRequest->getText( 'wpReason' ); $this->moveTalk = $wgRequest->getBool( 'wpMovetalk', true ); - $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ); + $this->deleteAndMove = $wgRequest->getBool( 'wpDeleteAndMove' ) && $wgRequest->getBool( 'wpConfirm' ); } function showForm( $err ) { @@ -90,12 +90,21 @@ class MovePageForm { if ( $err == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { $wgOut->addWikiText( wfMsg( 'delete_and_move_text', $encNewTitle ) ); $movepagebtn = wfMsgHtml( 'delete_and_move' ); + $confirmText = wfMsgHtml( 'delete_and_move_confirm' ); $submitVar = 'wpDeleteAndMove'; + $confirm = " + + + + + + "; $err = ''; } else { $wgOut->addWikiText( wfMsg( 'movepagetext' ) ); $movepagebtn = wfMsgHtml( 'movepagebtn' ); $submitVar = 'wpMove'; + $confirm = false; } if ( !$ot->isTalkPage() ) { @@ -149,6 +158,7 @@ class MovePageForm { " ); } $wgOut->addHTML( " + {$confirm}   diff --git a/languages/Language.php b/languages/Language.php index 998485fe1a..727ccd22ff 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1593,6 +1593,7 @@ title. Please merge them manually.'''", '==Deletion required== The destination article "[[$1]]" already exists. Do you want to delete it to make way for the move?', +'delete_and_move_confirm' => 'Yes, delete the page', 'delete_and_move_reason' => 'Deleted to make way for move', 'selfmove' => "Source and destination titles are the same; can't move a page over itself.", 'immobile_namespace' => "Destination title is of a special type; cannot move pages into that namespace.",