Add plus character + to legal mime subtype

For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip`
This commit is contained in:
Ilia Lazarev 2019-10-12 10:36:35 +03:00 committed by Nicolas Grekas
parent fefb2ff020
commit 56895f12b9

View File

@ -89,7 +89,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface
$type = trim(ob_get_clean());
if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\.]+)#i', $type, $match)) {
if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\+\.]+)#i', $type, $match)) {
// it's not a type, but an error message
return null;
}