From 0ea2bcdbeaa453f00324c14f90b71f545e1d706c Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 7 Jul 2005 06:51:23 +0000 Subject: [PATCH] * (bug 1130) Reorder old title checks; use title null instead of empty string check, encode the pretty title (spaces instead of underscores) --- includes/SpecialMovepage.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 ); -- 2.20.1