Rillke has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149005

Change subject: Unify MIME in documentation and equip note with sense
......................................................................

Unify MIME in documentation and equip note with sense

Writing MIME as written in Wikipedia and cleaning up a botched
sentence.

Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
---
M includes/upload/UploadBase.php
1 file changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/149005/1

diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php
index 5defd45..acfc367 100644
--- a/includes/upload/UploadBase.php
+++ b/includes/upload/UploadBase.php
@@ -377,11 +377,12 @@
        }
 
        /**
-        * 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 a blacklisted MIME type.
+        *  An accurate file extension is not mandatory here as it is checked
+        *  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 ) {
@@ -396,7 +397,7 @@
                                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 );
@@ -487,7 +488,7 @@
 
                $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 ) {
@@ -995,9 +996,9 @@
        }
 
        /**
-        * 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 @@
         * 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
         */

-- 
To view, visit https://gerrit.wikimedia.org/r/149005
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Rillke <ril...@wikipedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to