From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/MimeMagic.php | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'includes/MimeMagic.php') diff --git a/includes/MimeMagic.php b/includes/MimeMagic.php index d52de994..39c82c9d 100644 --- a/includes/MimeMagic.php +++ b/includes/MimeMagic.php @@ -118,19 +118,19 @@ class MimeMagic { * Mapping of media types to arrays of mime types. * This is used by findMediaType and getMediaType, respectively */ - var $mMediaTypes= NULL; + var $mMediaTypes= null; /** Map of mime type aliases */ - var $mMimeTypeAliases= NULL; + var $mMimeTypeAliases= null; /** map of mime types to file extensions (as a space seprarated list) */ - var $mMimeToExt= NULL; + var $mMimeToExt= null; /** map of file extensions types to mime types (as a space seprarated list) */ - var $mExtToMime= NULL; + var $mExtToMime= null; /** IEContentAnalyzer instance */ @@ -328,7 +328,7 @@ class MimeMagic { */ function guessTypesForExtension( $ext ) { $m = $this->getTypesForExtension( $ext ); - if ( is_null( $m ) ) return NULL; + if ( is_null( $m ) ) return null; $m = trim( $m ); $m = preg_replace( '/\s.*$/', '', $m ); @@ -345,7 +345,7 @@ class MimeMagic { $ext = $this->getExtensionsForType( $mime ); if ( !$ext ) { - return NULL; //unknown + return null; //unknown } $ext = explode( ' ', $ext ); @@ -469,16 +469,18 @@ class MimeMagic { } /* - * look for PHP - * Check for this before HTML/XML... - * Warning: this is a heuristic, and won't match a file with a lot of non-PHP before. - * It will also match text files which could be PHP. :) + * Look for PHP. Check for this before HTML/XML... Warning: this is a + * heuristic, and won't match a file with a lot of non-PHP before. It + * will also match text files which could be PHP. :) + * + * FIXME: For this reason, the check is probably useless -- an attacker + * could almost certainly just pad the file with a lot of nonsense to + * circumvent the check in any case where it would be a security + * problem. On the other hand, it causes harmful false positives (bug + * 16583). The heuristic has been cut down to exclude three-character + * strings like "