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:
authorJulius Härtl <jus@bitgrid.net>2020-09-07 17:29:39 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-09-09 15:17:27 +0300
commitb3c5271c89b6120b0407484895e8f975958d33c7 (patch)
tree6b3acf77a07e5d41e7dbf3ef301dcd69fbd0a5a2 /lib
parent1ed0a8caced114f5ddaea2eed02e37727cb58a95 (diff)
Properly add both mimetypes to secure mimetype mapping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Type/Detection.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Files/Type/Detection.php b/lib/private/Files/Type/Detection.php
index 1352963fc67..4e7f89778a4 100644
--- a/lib/private/Files/Type/Detection.php
+++ b/lib/private/Files/Type/Detection.php
@@ -120,8 +120,14 @@ class Detection implements IMimeTypeDetector {
$this->mimetypes = array_merge($this->mimetypes, $types);
// Update the alternative mimetypes to avoid having to look them up each time.
- foreach ($this->mimetypes as $mimeType) {
+ foreach ($this->mimetypes as $extension => $mimeType) {
+ if (strpos($extension, '_comment') === 0) {
+ continue;
+ }
$this->secureMimeTypes[$mimeType[0]] = $mimeType[1] ?? $mimeType[0];
+ if (isset($mimeType[1])) {
+ $this->secureMimeTypes[$mimeType[1]] = $mimeType[1];
+ }
}
}