mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-02 11:26:04 +01:00
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:
committed by
Andy Miller
parent
365ab2e062
commit
a3358c0e65
@@ -325,7 +325,7 @@ class AdminBaseController
|
||||
}
|
||||
|
||||
$isMime = strstr($type, '/');
|
||||
$find = str_replace(['.', '*'], ['\.', '.*'], $type);
|
||||
$find = str_replace(['.', '*', '+'], ['\.', '.*', '\+'], $type);
|
||||
|
||||
if ($isMime) {
|
||||
$match = preg_match('#' . $find . '$#', $mime);
|
||||
|
||||
Reference in New Issue
Block a user