From ef180861022e9c9b1fa82d36f7a2d6e2ccc71397 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 10 Oct 2008 01:02:39 +0000 Subject: [PATCH] Fix error display on invalid destination title on GET, e.g. with URL /wiki/Special:MovePage/Main_Page?wpNewTitle=Main_Page . Broken by r35990 and again by r41343. --- includes/specials/SpecialMovepage.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index f86d9544bb..e90c4a599a 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -97,21 +97,17 @@ class MovePageForm { # when the form is first opened. $newTitle = $this->oldTitle; } - // WTF is this doing, passing title *object* to newFromUrl()?? - /*else { + else { if( empty($err) ) { - $nt = Title::newFromURL( $this->newTitle ); - if( $nt ) { - # If a title was supplied, probably from the move log revert - # link, check for validity. We can then show some diagnostic - # information and save a click. - $newerr = $this->oldTitle->isValidMoveOperation( $nt ); - if( is_string( $newerr ) ) { - $err = $newerr; - } + # If a title was supplied, probably from the move log revert + # link, check for validity. We can then show some diagnostic + # information and save a click. + $newerr = $this->oldTitle->isValidMoveOperation( $newTitle ); + if( $newerr ) { + $err = $newerr[0]; } } - }*/ + } if ( !empty($err) && $err[0] == 'articleexists' && $wgUser->isAllowed( 'delete' ) ) { $wgOut->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() ); -- 2.20.1