mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 19:06:16 +01:00
Add ability to Sanitize SVGs on upload
This commit is contained in:
@@ -10,6 +10,7 @@ use Grav\Common\Grav;
|
||||
use Grav\Common\Media\Interfaces\MediaInterface;
|
||||
use Grav\Common\Page\Interfaces\PageInterface;
|
||||
use Grav\Common\Page\Media;
|
||||
use Grav\Common\Security;
|
||||
use Grav\Common\Uri;
|
||||
use Grav\Common\User\Interfaces\UserInterface;
|
||||
use Grav\Common\Utils;
|
||||
@@ -388,6 +389,11 @@ class AdminBaseController
|
||||
return false;
|
||||
}
|
||||
|
||||
// Special Sanitization for SVG
|
||||
if (Utils::contains($mime, 'svg', false)) {
|
||||
Security::sanitizeSVG($tmp);
|
||||
}
|
||||
|
||||
$upload->file->tmp_name = $tmp;
|
||||
|
||||
// Retrieve the current session of the uploaded files for the field
|
||||
|
||||
Reference in New Issue
Block a user