diff options
author | Sam Tuke <samtuke@owncloud.com> | 2013-02-09 11:52:11 +0000 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2013-02-09 11:52:11 +0000 |
commit | b95bc663af4135eff12a6a0c97afe37859f35094 (patch) | |
tree | 3ebb198e5f10ae34b9478b925e4a58d0be3c4aea /lib/helper.php | |
parent | d2b288ca704af4d74d1fa13e44966b1c34cf56bd (diff) | |
parent | ab4ae2b952fedf7bac2810bb6be7997fb661a1fc (diff) | |
download | nextcloud-server-b95bc663af4135eff12a6a0c97afe37859f35094.tar.gz nextcloud-server-b95bc663af4135eff12a6a0c97afe37859f35094.zip |
Merge branch 'master' into files_encryption-style-fixes
Conflicts:
apps/files_encryption/lib/crypt.php
apps/files_encryption/lib/util.php
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/helper.php b/lib/helper.php index 0e549d006a1..a0fbdd10394 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -394,13 +394,12 @@ class OC_Helper { // it looks like we have a 'file' command, // lets see if it does have mime support $path=escapeshellarg($path); - $fp = popen("file -i -b $path 2>/dev/null", "r"); + $fp = popen("file -b --mime-type $path 2>/dev/null", "r"); $reply = fgets($fp); pclose($fp); - // we have smth like 'text/x-c++; charset=us-ascii\n' - // and need to eliminate everything starting with semicolon including trailing LF - $mimeType = preg_replace('/;.*/ms', '', trim($reply)); + //trim the newline + $mimeType = trim($reply); } return $mimeType; |