*/
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;
}
}
}
if ( $this->mFileSize == 0 ) {
- $warnings['emptyfile'] = true;
+ $warnings['empty-file'] = true;
}
$exists = self::getExistsWarning( $localFile );