Fix accept for SVG files in file uploaders: (#1732)

Using `accept: 'image/svg+xml' to only allow SVG file to be uploaded should now work.

The `preg_match` was comparing `svgggg…xml` with `svg+xml`.

Check the [List of Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml#image) for more potential issues.
This commit is contained in:
Fabien Basmaison
2019-10-23 22:48:06 +02:00
committed by Andy Miller
parent 365ab2e062
commit a3358c0e65

View File

@@ -325,7 +325,7 @@ class AdminBaseController
}
$isMime = strstr($type, '/');
$find = str_replace(['.', '*'], ['\.', '.*'], $type);
$find = str_replace(['.', '*', '+'], ['\.', '.*', '\+'], $type);
if ($isMime) {
$match = preg_match('#' . $find . '$#', $mime);