Skip to content

Commit

Permalink
bug #33965 [HttpFoundation] Add plus character + to legal mime subt…
Browse files Browse the repository at this point in the history
…ype (ilzrv)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Add plus character `+` to legal mime subtype

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

For example, the following mime type (used for epub) is not recognized given the current regexp: `application/epub+zip; charset=binary`

Commits
-------

56895f1 Add plus character `+` to legal mime subtype
  • Loading branch information
nicolas-grekas committed Oct 12, 2019
2 parents fefb2ff + 56895f1 commit a8a4aad
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -89,7 +89,7 @@ public function guess($path)

$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;
}
Expand Down

0 comments on commit a8a4aad

Please sign in to comment.