check if we can read the file before trying to get it's mime type

This commit is contained in:
Robin Appelman 2011-01-22 02:28:29 +01:00
parent 9cd4c99918
commit 15d15104d4
1 changed files with 87 additions and 85 deletions

View File

@ -208,6 +208,7 @@ class OC_FILESTORAGE_LOCAL extends OC_FILESTORAGE{
}
public function getMimeType($fspath){
if($this->is_readable($fspath)){
if (@is_dir($this->datadir.$fspath)) {
// directories are easy
return "httpd/unix-directory";
@ -297,6 +298,7 @@ class OC_FILESTORAGE_LOCAL extends OC_FILESTORAGE{
return $mime_type;
}
}
/**
* detect if a given program is found in the search PATH