UploadBase: Replace 'emptyfile' warning code by 'empty-file'
[lhc/web/wiklou.git] / includes / upload / UploadBase.php
index fb25249..9837a95 100644 (file)
@@ -241,12 +241,14 @@ abstract class UploadBase {
         */
        protected function setTempFile( $tempPath, $fileSize = null ) {
                $this->mTempPath = $tempPath;
+               $this->mFileSize = $fileSize ?: null;
                if ( strlen( $this->mTempPath ) && file_exists( $this->mTempPath ) ) {
                        $this->tempFileObj = new TempFSFile( $this->mTempPath );
-                       $this->mFileSize = $fileSize ?: filesize( $this->mTempPath );
+                       if ( !$fileSize ) {
+                               $this->mFileSize = filesize( $this->mTempPath );
+                       }
                } else {
                        $this->tempFileObj = null;
-                       $this->mFileSize = null;
                }
        }
 
@@ -664,7 +666,7 @@ abstract class UploadBase {
                }
 
                if ( $this->mFileSize == 0 ) {
-                       $warnings['emptyfile'] = true;
+                       $warnings['empty-file'] = true;
                }
 
                $exists = self::getExistsWarning( $localFile );