From fdb634764cbd51670e606f2df1a82807ea91cf79 Mon Sep 17 00:00:00 2001 From: franzz Date: Fri, 22 Feb 2019 21:16:09 +0100 Subject: [PATCH] fix getMimeType --- inc/toolbox.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }