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
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2016-09-20 09:38:31 +0300
committerGitHub <noreply@github.com>2016-09-20 09:38:31 +0300
commit0b51c9ac4d36ef7440397a0497fb757478cf909c (patch)
tree5f258b1bdeff6bb697d38d664fd7511c2e47c288 /lib
parent8771eb3989e4a10c5506c2d15d0193e82c335b89 (diff)
[stable9] Fix mimetype detection inside hidden folders (#26138) (#26152)
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 f106a98064f..91db16ed080 100644
--- a/lib/private/files/type/detection.php
+++ b/lib/private/files/type/detection.php
@@ -164,9 +164,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]