From a5eabe67a19d7a32b5093d5de2fa269861bdcb55 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Wed, 26 Aug 2009 17:08:49 +0000 Subject: [PATCH] Removed the $tmpFile parameter to UploadBase::verifyUpload in favour of $this->mTempFile. --- includes/upload/UploadBase.php | 8 ++++---- includes/upload/UploadFromChunks.php | 2 +- includes/upload/UploadFromStash.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 52bb2487dd..aeca23ddf1 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -170,7 +170,7 @@ abstract class UploadBase { * type but it's corrupt or data of the wrong type, we should * probably not accept it. */ - $verification = $this->verifyFile( $this->mTempPath ); + $verification = $this->verifyFile(); if( $verification !== true ) { if( !is_array( $verification ) ) @@ -196,13 +196,13 @@ abstract class UploadBase { * @param string $tmpfile the full path of the temporary file to verify * @return mixed true of the file is verified, a string or array otherwise. */ - protected function verifyFile( $tmpfile ) { + protected function verifyFile() { $this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension ); $this->checkMacBinary(); #magically determine mime type $magic = MimeMagic::singleton(); - $mime = $magic->guessMimeType( $tmpfile, false ); + $mime = $magic->guessMimeType( $this->mTempFile, false ); #check mime type, if desired global $wgVerifyMimeType; @@ -212,7 +212,7 @@ abstract class UploadBase { return array( 'filetype-badmime', $mime ); # Check IE type - $fp = fopen( $tmpfile, 'rb' ); + $fp = fopen( $this->mTempFile, 'rb' ); $chunk = fread( $fp, 256 ); fclose( $fp ); $extMime = $magic->guessTypesForExtension( $this->mFinalExtension ); diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index a77ac7f45d..3ac54018be 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -88,7 +88,7 @@ class UploadFromChunks extends UploadBase { } // only run verifyFile on completed uploaded chunks - function verifyFile( $tmpFile ){ + function verifyFile(){ if( $this->chunk_mode == UploadFromChunks::DONE ){ // first append last chunk (so we can do a real verifyFile check... (check file type etc) $status = $this->doChunkAppend(); diff --git a/includes/upload/UploadFromStash.php b/includes/upload/UploadFromStash.php index 06eb163e8f..cd1d859b53 100644 --- a/includes/upload/UploadFromStash.php +++ b/includes/upload/UploadFromStash.php @@ -56,7 +56,7 @@ class UploadFromStash extends UploadBase { /** * File has been previously verified so no need to do so again. */ - protected function verifyFile( $tmpfile ) { + protected function verifyFile() { return true; } -- 2.20.1