Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / specials / SpecialUpload.php
index 5a1b8fb..68fda49 100644 (file)
@@ -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.