Tweak for E_STRICT warning "Undefined index: in includes/MimeMagic.php on line...
authorNick Jenkins <nickj@users.mediawiki.org>
Mon, 23 Apr 2007 01:41:19 +0000 (01:41 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Mon, 23 Apr 2007 01:41:19 +0000 (01:41 +0000)
curl --silent --include --globoff -F 'f'='..' -F 'w'='1930' -F 'r'='\</rp></dt>' 'http://localhost/wiki/thumb.php'
(Only happens because E_STRICT seems to disable the @ error control operator)

includes/MimeMagic.php

index 516a3cd..df7a474 100644 (file)
@@ -262,7 +262,7 @@ class MimeMagic {
        function getTypesForExtension($ext) {
                $ext= strtolower($ext);
 
-               $r= @$this->mExtToMime[$ext];
+               $r= isset( $this->mExtToMime[$ext] ) ? $this->mExtToMime[$ext] : null;
                return $r;
        }