From 5977d6eb09c09e1f47a5cd02a2ee0618e6dd429e Mon Sep 17 00:00:00 2001 From: Alex Z Date: Sat, 26 Dec 2009 22:04:37 +0000 Subject: [PATCH] Fix for r60418, need to check whether the /destination/ file exists locally, not the file at the current title --- includes/Title.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index 89b01f4230..d0fee24988 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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' ); } -- 2.20.1