r62809 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62808‎ | r62809 | r62810 >
Date:03:07, 22 February 2010
Author:mah
Status:ok
Tags:
Comment:
follow up r53282
Recover the use of verifyExtension that was lost in r53282
Modified paths:
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1203,6 +1203,7 @@
12041204 'minlength1',
12051205 'illegalfilename',
12061206 'badfilename',
 1207+ 'filetype-mime-mismatch',
12071208 'filetype-badmime',
12081209 'filetype-bad-ie-mime',
12091210 'filetype-unwanted-type',
Index: trunk/phase3/includes/upload/UploadBase.php
@@ -239,6 +239,11 @@
240240 # check mime type, if desired
241241 global $wgVerifyMimeType;
242242 if ( $wgVerifyMimeType ) {
 243+ wfDebug ( "\n\nmime: <$mime> extension: <{$this->mFinalExtension}>\n\n");
 244+ if ( !$this->verifyExtension( $mime, $this->mFinalExtension ) ) {
 245+ return array( 'filetype-mime-mismatch' );
 246+ }
 247+
243248 global $wgMimeTypeBlacklist;
244249 if ( $this->checkFileExtension( $mime, $wgMimeTypeBlacklist ) ) {
245250 return array( 'filetype-badmime', $mime );
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -2040,6 +2040,7 @@
20412041 'illegalfilename' => 'The filename "$1" contains characters that are not allowed in page titles.
20422042 Please rename the file and try uploading it again.',
20432043 'badfilename' => 'File name has been changed to "$1".',
 2044+'filetype-mime-mismatch' => 'File extension does not match MIME type.',
20442045 'filetype-badmime' => 'Files of the MIME type "$1" are not allowed to be uploaded.',
20452046 'filetype-bad-ie-mime' => 'Cannot upload this file because Internet Explorer would detect it as "$1", which is a disallowed and potentially dangerous file type.',
20462047 'filetype-unwanted-type' => "'''\".\$1\"''' is an unwanted file type.

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r53282here it is ... the upload-api, script-server, js2 (javascript phase2) branch ...dale23:52, 14 July 2009

Status & tagging log