summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Type/Detection.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php
index 66ef0dd2aab..84d727ebb0e 100644
--- a/lib/private/Files/Type/Detection.php
+++ b/lib/private/Files/Type/Detection.php
@@ -166,9 +166,11 @@ class Detection implements IMimeTypeDetector {
public function detectPath($path) {
$this->loadMappings();
- if (strpos($path, '.')) {
+ $fileName = basename($path);
+ // note: leading dot doesn't qualify as extension
+ if (strpos($fileName, '.') > 0) {
//try to guess the type by the file extension
- $extension = strtolower(strrchr(basename($path), "."));
+ $extension = strtolower(strrchr($fileName, '.'));
$extension = substr($extension, 1); //remove leading .
return (isset($this->mimetypes[$extension]) && isset($this->mimetypes[$extension][0]))
? $this->mimetypes[$extension][0]