mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Get 1st array value seperately
Some older versions of PHP don't seem to like calling [0] on the same line as explode Now getting value on seperate line of code
This commit is contained in:
@@ -30,7 +30,8 @@ if ($_GET['action']=="load") {
|
||||
$finfo = finfo_file($finfoMIME, $file);
|
||||
finfo_close($finfoMIME);
|
||||
} else {
|
||||
$fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION))[0];
|
||||
$fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION));
|
||||
$fileExt = $fileExt[0];
|
||||
if (array_search($fileExt,array("coffee","css","htm","html","js","less","md","php","py","rb","ruby","txt","xml"))!==false) {$finfo = "text";};
|
||||
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user