From 4c043d581dda9181d805057ba7336813bf4403f5 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Sat, 5 Mar 2011 14:47:11 +0000 Subject: [PATCH] Follow-up r83282: Re-add the lost $this->getNamespace() == NS_FILE, forgot to test the code for normal pages. --- includes/Title.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 4c5f0183f6..be0dbd19fd 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -2986,7 +2986,13 @@ class Title { } // Image-specific checks - $errors = array_merge( $errors, $this->validateFileMoveOperation( $nt ) ); + if ( $this->getNamespace() == NS_FILE ) { + $errors = array_merge( $errors, $this->validateFileMoveOperation( $nt ) ); + } + + if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) { + $errors[] = array( 'nonfile-cannot-move-to-file' ); + } if ( $auth ) { $errors = wfMergeErrorArrays( $errors, @@ -3056,10 +3062,6 @@ class Title { if ( !$wgUser->isAllowed( 'reupload-shared' ) && !$destfile->exists() && wfFindFile( $nt ) ) { $errors[] = array( 'file-exists-sharedrepo' ); } - - if ( $nt->getNamespace() == NS_FILE && $this->getNamespace() != NS_FILE ) { - $errors[] = array( 'nonfile-cannot-move-to-file' ); - } return $errors; } -- 2.20.1