diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-01-16 06:06:11 +0400 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-01-16 06:06:11 +0400 |
commit | 96e2f15d8a6eee83e30bdf77ef3582f0c26b52e0 (patch) | |
tree | 9df43704cb7e580d328d6780561a0ec146003e7b /lib/filestorage | |
parent | ccc43f0ea02a048583fff715f00cda0280124586 (diff) | |
parent | b0dbca0cc7f2d07dbf01c54861b932d8dc9fe2df (diff) |
merge master into filesystem
Diffstat (limited to 'lib/filestorage')
-rw-r--r-- | lib/filestorage/local.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 18bfd69d719..dcffce6e867 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -120,6 +120,13 @@ class OC_Filestorage_Local extends OC_Filestorage{ public function getMimeType($fspath){ if($this->is_readable($fspath)){ $mimeType='application/octet-stream'; + if ($mimeType=='application/octet-stream') { + self::$mimetypes = include('mimetypes.fixlist.php'); + $extention=strtolower(strrchr(basename($fspath), ".")); + $extention=substr($extention,1);//remove leading . + $mimeType=(isset(self::$mimetypes[$extention]))?self::$mimetypes[$extention]:'application/octet-stream'; + + } if (@is_dir($this->datadir.$fspath)) { // directories are easy return "httpd/unix-directory"; @@ -146,7 +153,7 @@ class OC_Filestorage_Local extends OC_Filestorage{ } if ($mimeType=='application/octet-stream') { // Fallback solution: (try to guess the type by the file extension - if(!self::$mimetypes){ + if(!self::$mimetypes || self::$mimetypes != include('mimetypes.list.php')){ self::$mimetypes=include('mimetypes.list.php'); } $extention=strtolower(strrchr(basename($fspath), ".")); |