Fix r110209: Move the invalid title check above the first use of the title object...
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 28 Feb 2012 02:55:36 +0000 (02:55 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 28 Feb 2012 02:55:36 +0000 (02:55 +0000)
includes/specials/SpecialMovepage.php

index 56217b3..af49815 100644 (file)
@@ -55,6 +55,13 @@ class MovePageForm extends UnlistedSpecialPage {
                $oldTitleText = $request->getVal( 'wpOldTitle', $target );
                $this->oldTitle = Title::newFromText( $oldTitleText );
 
+               if( is_null( $this->oldTitle ) ) {
+                       throw new ErrorPageError( 'notargettitle', 'notargettext' );
+               }
+               if( !$this->oldTitle->exists() ) {
+                       throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
+               }
+
                $newTitleTextMain = $request->getText( 'wpNewTitleMain' );
                $newTitleTextNs = $request->getInt( 'wpNewTitleNs', $this->oldTitle->getNamespace() );
                // Backwards compatibility for forms submitting here from other sources
@@ -64,12 +71,6 @@ class MovePageForm extends UnlistedSpecialPage {
                        ? Title::newFromText( $newTitleText_bc )
                        : Title::makeTitleSafe( $newTitleTextNs, $newTitleTextMain );
 
-               if( is_null( $this->oldTitle ) ) {
-                       throw new ErrorPageError( 'notargettitle', 'notargettext' );
-               }
-               if( !$this->oldTitle->exists() ) {
-                       throw new ErrorPageError( 'nopagetitle', 'nopagetext' );
-               }
 
                $user = $this->getUser();