Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2026-02-27 18:04:35 +09:00 committed by GitHub
commit 25f6d02677
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 945 additions and 1153 deletions

View file

@ -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);