summaryrefslogtreecommitdiff
path: root/includes/specials
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials')
-rw-r--r--includes/specials/SpecialMovepage.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php
index d7ebd310..5536fbc9 100644
--- a/includes/specials/SpecialMovepage.php
+++ b/includes/specials/SpecialMovepage.php
@@ -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();