summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-07 16:29:39 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-09-09 12:17:26 +0000
commit554fab45aa9497b5c74c9c57945696d896e856a6 (patch)
tree647aa28e866fdb748f327c82ad971304cac1405f
parent02a6cac39ddd619b2a0710e3fba703f3d72ee13d (diff)
downloadnextcloud-server-554fab45aa9497b5c74c9c57945696d896e856a6.tar.gz
nextcloud-server-554fab45aa9497b5c74c9c57945696d896e856a6.zip
Properly add both mimetypes to secure mimetype mapping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-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 e8825037666..64a7701011d 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];
+ }
}
}