Properly add both mimetypes to secure mimetype mapping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
16e1d1cb12
commit
5e4303b1fe
|
@ -122,8 +122,14 @@ class Detection implements IMimeTypeDetector {
|
||||||
$this->mimetypes = array_merge($this->mimetypes, $types);
|
$this->mimetypes = array_merge($this->mimetypes, $types);
|
||||||
|
|
||||||
// Update the alternative mimetypes to avoid having to look them up each time.
|
// 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];
|
$this->secureMimeTypes[$mimeType[0]] = $mimeType[1] ?? $mimeType[0];
|
||||||
|
if (isset($mimeType[1])) {
|
||||||
|
$this->secureMimeTypes[$mimeType[1]] = $mimeType[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue