mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Use enshrined\svgSanitize to clean SVG file content
This commit is contained in:
parent
a18b45f0f8
commit
bf2df84d0f
2 changed files with 14 additions and 0 deletions
|
|
@ -38,6 +38,12 @@ class Security
|
|||
if (!utf8_check($input)) return false;
|
||||
return Filters\FilenameFilter::clean($input);
|
||||
|
||||
// Clean up SVG content to prevent various attacks.
|
||||
case 'svg':
|
||||
if (!utf8_check($input)) return false;
|
||||
$sanitizer = new \enshrined\svgSanitize\Sanitizer();
|
||||
return strval($sanitizer->sanitize($input));
|
||||
|
||||
// Unknown filters.
|
||||
default:
|
||||
throw new Exception('Unknown filter type for sanitize: ' . $type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue