From: Alex Z Date: Sat, 26 Dec 2009 22:04:37 +0000 (+0000) Subject: Fix for r60418, need to check whether the /destination/ file exists X-Git-Tag: 1.31.0-rc.0~38470 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=5977d6eb09c09e1f47a5cd02a2ee0618e6dd429e;p=lhc%2Fweb%2Fwiklou.git Fix for r60418, need to check whether the /destination/ file exists locally, not the file at the current title --- 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' ); }