diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-09-08 10:41:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-08 10:41:09 +0200 |
commit | 919a8d473b0f63de585fe37c44368a4ddcf4253a (patch) | |
tree | 40dc45a515401d50b60102656f010a62aeab8f7a /lib/private | |
parent | b4729ce1423b456a90a0ee6ed12230e015adc141 (diff) | |
parent | 16b981735895424dd2d59707af87716c0e04d363 (diff) | |
download | nextcloud-server-919a8d473b0f63de585fe37c44368a4ddcf4253a.tar.gz nextcloud-server-919a8d473b0f63de585fe37c44368a4ddcf4253a.zip |
Merge pull request #22646 from nextcloud/bugfix/mimetype-mapping
Fix detecting text/x-php mimetype and secure mimetype mapping
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/Type/Detection.php | 8 |
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]; + } } } |