Merge "Added a few more trx sanity checks to DatabaseBase"
[lhc/web/wiklou.git] / includes / upload / UploadFromFile.php
index fae9974..a00ed32 100644 (file)
@@ -36,26 +36,25 @@ class UploadFromFile extends UploadBase {
 
        /**
         * @param $request WebRequest
-        * @return null
         */
        function initializeFromRequest( &$request ) {
-               $upload = $request->getUpload( 'wpUploadFile' );                
+               $upload = $request->getUpload( 'wpUploadFile' );
                $desiredDestName = $request->getText( 'wpDestFile' );
-               if( !$desiredDestName )
+               if ( !$desiredDestName ) {
                        $desiredDestName = $upload->getName();
-                       
-               return $this->initialize( $desiredDestName, $upload );
+               }
+
+               $this->initialize( $desiredDestName, $upload );
        }
 
        /**
         * Initialize from a filename and a WebRequestUpload
         * @param $name
         * @param $webRequestUpload
-        * @return null
         */
        function initialize( $name, $webRequestUpload ) {
                $this->mUpload = $webRequestUpload;
-               return $this->initializePathInfo( $name, 
+               $this->initializePathInfo( $name,
                        $this->mUpload->getTempName(), $this->mUpload->getSize() );
        }
 
@@ -80,21 +79,21 @@ class UploadFromFile extends UploadBase {
         * @return array
         */
        public function verifyUpload() {
-               # Check for a post_max_size or upload_max_size overflow, so that a 
+               # Check for a post_max_size or upload_max_size overflow, so that a
                # proper error can be shown to the user
                if ( is_null( $this->mTempPath ) || $this->isEmptyFile() ) {
                        if ( $this->mUpload->isIniSizeOverflow() ) {
-                               return array( 
+                               return array(
                                        'status' => UploadBase::FILE_TOO_LARGE,
-                                       'max' => min( 
-                                               self::getMaxUploadSize( $this->getSourceType() ), 
-                                               wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ), 
+                                       'max' => min(
+                                               self::getMaxUploadSize( $this->getSourceType() ),
+                                               wfShorthandToInteger( ini_get( 'upload_max_filesize' ) ),
                                                wfShorthandToInteger( ini_get( 'post_max_size' ) )
                                        ),
                                );
                        }
                }
-               
+
                return parent::verifyUpload();
        }
 }