From: Brion Vibber Date: Thu, 7 Jul 2005 06:51:23 +0000 (+0000) Subject: * (bug 1130) Reorder old title checks; use title null instead of empty X-Git-Tag: 1.5.0beta3~1 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=0ea2bcdbeaa453f00324c14f90b71f545e1d706c;p=lhc%2Fweb%2Fwiklou.git * (bug 1130) Reorder old title checks; use title null instead of empty string check, encode the pretty title (spaces instead of underscores) --- diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index 447eaf82e1..fb66e31146 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -63,19 +63,18 @@ class MovePageForm { $wgOut->setPagetitle( wfMsg( 'movepage' ) ); - if ( $this->oldTitle == '' ) { + $ot = Title::newFromURL( $this->oldTitle ); + if( is_null( $ot ) ) { $wgOut->errorpage( 'notargettitle', 'notargettext' ); return; } - - $ot = Title::newFromURL( $this->oldTitle ); $oldTitle = $ot->getPrefixedText(); - $encOldTitle = htmlspecialchars( $this->oldTitle ); + $encOldTitle = htmlspecialchars( $oldTitle ); if( $this->newTitle == '' ) { # Show the current title as a default # when the form is first opened. - $encNewTitle = $oldTitle; + $encNewTitle = $encOldTitle; } else { if( $err == '' ) { $nt = Title::newFromURL( $this->newTitle );