From: Robin Appelman Date: Sun, 30 Sep 2012 01:58:58 +0000 (+0200) Subject: fix mimetype detection using the 'file' command in some edge cases X-Git-Tag: v4.5.0RC2~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=258782584e490b92ccfcf032921aa7062a28da9f;p=nextcloud-server.git fix mimetype detection using the 'file' command in some edge cases --- diff --git a/lib/helper.php b/lib/helper.php index 8e578735f4c..908a61b5a2d 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -370,6 +370,7 @@ class OC_Helper { //trim the character set from the end of the response $mimeType=substr($reply,0,strrpos($reply,' ')); + $mimeType=substr($mimeType,0,strrpos($mimeType,"\n")); //trim ; if (strpos($mimeType, ';') !== false) {