Merge pull request #22745 from nextcloud/backport/22646/stable19
[stable19] Fix detecting text/x-php mimetype and secure mimetype mapping
This commit is contained in:
commit
968a756067
|
@ -120,8 +120,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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@
|
||||||
"pdf": ["application/pdf"],
|
"pdf": ["application/pdf"],
|
||||||
"pfb": ["application/x-font"],
|
"pfb": ["application/x-font"],
|
||||||
"pef": ["image/x-dcraw"],
|
"pef": ["image/x-dcraw"],
|
||||||
"php": ["application/x-php"],
|
"php": ["application/x-php", "text/x-php"],
|
||||||
"pl": ["application/x-perl"],
|
"pl": ["application/x-perl"],
|
||||||
"pls": ["audio/x-scpls"],
|
"pls": ["audio/x-scpls"],
|
||||||
"png": ["image/png"],
|
"png": ["image/png"],
|
||||||
|
|
Loading…
Reference in New Issue