diff --git a/inc/toolbox.php b/inc/toolbox.php index 023ed48..c35722a 100755 --- a/inc/toolbox.php +++ b/inc/toolbox.php @@ -127,6 +127,7 @@ class ToolBox public static function getMimeType($sPath, $bSubTypeOnly=false) { + $sMimetype = ''; //Retrieving file Content Type if(file_exists($sPath)) //Local { @@ -152,7 +153,7 @@ class ToolBox if($bSubTypeOnly) { preg_match('`\/(?P\w+)(\;|$)`ui', mb_strtolower($sMimetype), $asMatch); - $sMimetype = $asMatch['type']; + if(array_key_exists('type', $asMatch)) $sMimetype = $asMatch['type']; } return $sMimetype; }