Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-01-12 21:26:13 +0400
committerGeorg Ehrke <dev@georgswebsite.de>2012-01-12 21:26:13 +0400
commita0ff21a2326e415bb1c0147ba2d96179d4036ca2 (patch)
tree06d89c90dd5ef003bfa564d944d6f6135ef075be /lib/filestorage
parent9e105d9bd756ef079c407772cba4d67f1a5193fe (diff)
added a file to fix wrong recognised mime-types
Diffstat (limited to 'lib/filestorage')
-rw-r--r--lib/filestorage/local.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index cfc27159786..1261bd3aa83 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -132,6 +132,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";
@@ -158,7 +165,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), "."));