Fix for r60418, need to check whether the /destination/ file exists
authorAlex Z <mrzman@users.mediawiki.org>
Sat, 26 Dec 2009 22:04:37 +0000 (22:04 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Sat, 26 Dec 2009 22:04:37 +0000 (22:04 +0000)
locally, not the file at the current title

includes/Title.php

index 89b01f4..d0fee24 100644 (file)
@@ -2686,7 +2686,9 @@ class Title {
                                if( !File::checkExtensionCompatibility( $file, $nt->getDBkey() ) ) {
                                        $errors[] = array('imagetypemismatch');
                                }
-                       } elseif( !$wgUser->isAllowed( 'reupload-shared' ) && wfFindFile( $nt ) ) {
+                       } 
+                       $destfile = wfLocalFile( $nt );
+                       if( !$wgUser->isAllowed( 'reupload-shared' ) && !$destfile->exists() && wfFindFile( $nt ) ) {
                                $errors[] = array( 'file-exists-sharedrepo' );
                        }