Consider extensions up to a space char

This enables ICEcoder to understand that image.jpg (2) is a jpeg and can
be opened as an image
This commit is contained in:
Matt Pass
2013-05-31 21:16:18 +01:00
parent 47cf80102c
commit 7255ea4805

View File

@@ -30,7 +30,7 @@ if ($_GET['action']=="load") {
$finfo = finfo_file($finfoMIME, $file);
finfo_close($finfoMIME);
} else {
$fileExt = pathinfo($file, PATHINFO_EXTENSION);
$fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION))[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";};
}