X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUpload.php;h=68fda497b74ba3dbf6f31d930a1ceb673b338314;hp=5a1b8fbf6d3f000eb3dc8ee8c246ede9a22f745c;hb=04d1aa3033f40a38d721f7f0e88b5bac440d2869;hpb=962b690e92a258bd53100e976dc5575180696bf0 diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 5a1b8fbf6d..68fda497b7 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -191,11 +191,9 @@ class SpecialUpload extends SpecialPage { $this->loadRequest(); # Unsave the temporary file in case this was a cancelled upload - if ( $this->mCancelUpload ) { - if ( !$this->unsaveUploadedFile() ) { - # Something went wrong, so unsaveUploadedFile showed a warning - return; - } + if ( $this->mCancelUpload && !$this->unsaveUploadedFile() ) { + # Something went wrong, so unsaveUploadedFile showed a warning + return; } # Process upload or show a form @@ -671,7 +669,8 @@ class SpecialUpload extends SpecialPage { return true; } - $local = wfLocalFile( $this->mDesiredDestName ); + $local = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo() + ->newFile( $this->mDesiredDestName ); if ( $local && $local->exists() ) { // We're uploading a new version of an existing file. // No creation, so don't watch it if we're not already.