From: Tim Starling Date: Fri, 10 Oct 2008 01:02:39 +0000 (+0000) Subject: Fix error display on invalid destination title on GET, e.g. with URL /wiki/Special... X-Git-Tag: 1.31.0-rc.0~44822 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=ef180861022e9c9b1fa82d36f7a2d6e2ccc71397;p=lhc%2Fweb%2Fwiklou.git 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. --- 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() );