From 7255ea4805b94b9896d8c015840d845d958c97bf Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 31 May 2013 21:16:18 +0100 Subject: [PATCH] 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 --- lib/file-control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/file-control.php b/lib/file-control.php index e57c3c5..9f4e826 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -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";}; }