diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-09-09 16:51:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 16:51:05 +0200 |
commit | 7591a94902eb387c3dd1b0897da1fe8f2eca30e2 (patch) | |
tree | e0c41ca4eaa107868697f82fc8b1aa88485c89e6 /lib | |
parent | c97df0f85292d4a4d85455c675b406e842c1ee74 (diff) | |
parent | 4b3d5fe66add71e485bc996de16cf55254cb64db (diff) | |
download | nextcloud-server-7591a94902eb387c3dd1b0897da1fe8f2eca30e2.tar.gz nextcloud-server-7591a94902eb387c3dd1b0897da1fe8f2eca30e2.zip |
Merge pull request #22746 from nextcloud/backport/22646/stable18
[stable18] Fix detecting text/x-php mimetype and secure mimetype mapping
Diffstat (limited to 'lib')
-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 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]; + } } } |