summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-09-07 16:29:39 +0200
committerJulius Härtl <jus@bitgrid.net>2020-09-07 16:42:11 +0200
commit5e4303b1fe19d3effdf003a44a2f679bec67340a (patch)
tree4ef9a329b0e85e859119976f477606a171f9c705 /lib
parent16e1d1cb12229270d61d89dfda93399d056d456c (diff)
downloadnextcloud-server-5e4303b1fe19d3effdf003a44a2f679bec67340a.tar.gz
nextcloud-server-5e4303b1fe19d3effdf003a44a2f679bec67340a.zip
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 6078a5934a6..f8cbd2ec725 100644
--- a/lib/private/Files/Type/Detection.php
+++ b/lib/private/Files/Type/Detection.php
@@ -122,8 +122,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];
+ }
}
}