* (bug 1130) Reorder old title checks; use title null instead of empty
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 7 Jul 2005 06:51:23 +0000 (06:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 7 Jul 2005 06:51:23 +0000 (06:51 +0000)
string check, encode the pretty title (spaces instead of underscores)

includes/SpecialMovepage.php

index 447eaf8..fb66e31 100644 (file)
@@ -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 );