Follow-up r83282: Re-add the lost $this->getNamespace() == NS_FILE, forgot to test...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 5 Mar 2011 14:47:11 +0000 (14:47 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Sat, 5 Mar 2011 14:47:11 +0000 (14:47 +0000)
includes/Title.php

index 4c5f018..be0dbd1 100644 (file)
@@ -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;
        }