Merge "EditPage::newSectionSummary should return a value in all code paths"
[lhc/web/wiklou.git] / includes / upload / UploadBase.php
index d1de993..4d74a2d 100644 (file)
@@ -283,7 +283,7 @@ abstract class UploadBase {
 
        /**
         * Verify whether the upload is sane.
-        * @return mixed self::OK or else an array with error information
+        * @return mixed Const self::OK or else an array with error information
         */
        public function verifyUpload() {
                wfProfileIn( __METHOD__ );
@@ -377,18 +377,19 @@ abstract class UploadBase {
        }
 
        /**
-        * Verify the mime type.
+        * Verify the MIME type.
         *
-        * @note Only checks that it is not an evil mime. The does it have
-        *  correct extension given its mime type check is in verifyFile.
-        * @param string $mime Representing the mime
+        * @note Only checks that it is not an evil MIME. The "does it have
+        *  correct extension given its MIME type?" check is in verifyFile.
+        *  in `verifyFile()` that MIME type and file extension correlate.
+        * @param string $mime Representing the MIME
         * @return mixed True if the file is verified, an array otherwise
         */
        protected function verifyMimeType( $mime ) {
                global $wgVerifyMimeType;
                wfProfileIn( __METHOD__ );
                if ( $wgVerifyMimeType ) {
-                       wfDebug( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n" );
+                       wfDebug( "mime: <$mime> extension: <{$this->mFinalExtension}>\n" );
                        global $wgMimeTypeBlacklist;
                        if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
                                wfProfileOut( __METHOD__ );
@@ -396,7 +397,7 @@ abstract class UploadBase {
                                return array( 'filetype-badmime', $mime );
                        }
 
-                       # Check IE type
+                       # Check what Internet Explorer would detect
                        $fp = fopen( $this->mTempPath, 'rb' );
                        $chunk = fread( $fp, 256 );
                        fclose( $fp );
@@ -435,7 +436,7 @@ abstract class UploadBase {
                }
 
                $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
-               $mime = $this->mFileProps['file-mime'];
+               $mime = $this->mFileProps['mime'];
 
                if ( $wgVerifyMimeType ) {
                        # XXX: Missing extension will be caught by validateName() via getTitle()
@@ -487,7 +488,7 @@ abstract class UploadBase {
 
                $this->mFileProps = FSFile::getPropsFromPath( $this->mTempPath, $this->mFinalExtension );
 
-               # check mime type, if desired
+               # check MIME type, if desired
                $mime = $this->mFileProps['file-mime'];
                $status = $this->verifyMimeType( $mime );
                if ( $status !== true ) {
@@ -593,7 +594,7 @@ abstract class UploadBase {
         * isAllowed() should be called as well for generic is-user-blocked or
         * can-user-upload checking.
         *
-        * @param User $user object to verify the permissions against
+        * @param User $user User object to verify the permissions against
         * @return mixed An array as returned by getUserPermissionsErrors or true
         *   in case the user has proper permissions.
         */
@@ -995,9 +996,9 @@ abstract class UploadBase {
        }
 
        /**
-        * Checks if the mime type of the uploaded file matches the file extension.
+        * Checks if the MIME type of the uploaded file matches the file extension.
         *
-        * @param string $mime The mime type of the uploaded file
+        * @param string $mime The MIME type of the uploaded file
         * @param string $extension The filename extension that the file is to be served with
         * @return bool
         */
@@ -1050,7 +1051,7 @@ abstract class UploadBase {
         * positives in some situations.
         *
         * @param string $file Pathname to the temporary upload file
-        * @param string $mime The mime type of the file
+        * @param string $mime The MIME type of the file
         * @param string $extension The extension of the file
         * @return bool True if the file contains something looking like embedded scripts
         */
@@ -1276,8 +1277,8 @@ abstract class UploadBase {
 
        /**
         * Callback to filter SVG Processing Instructions.
-        * @param string $target processing instruction name
-        * @param string $data processing instruction attribute and value
+        * @param string $target Processing instruction name
+        * @param string $data Processing instruction attribute and value
         * @return bool (true if the filter identified something bad)
         */
        public static function checkSvgPICallback( $target, $data ) {