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

@ -551,7 +551,7 @@ class FileController extends File
{
$download_type = 'inline';
}
if (Context::get('force_download') === 'Y')
if ($mime_type === 'image/svg+xml' || Context::get('force_download') === 'Y')
{
$download_type = 'attachment';
}
@ -936,6 +936,14 @@ class FileController extends File
}
}
// Sanitize SVG
if(!$manual_insert && !$this->user->isAdmin() && ($file_info['type'] === 'image/svg+xml' || $file_info['extension'] === 'svg'))
{
$dirty_svg = Rhymix\Framework\Storage::read($file_info['tmp_name']);
$clean_svg = Rhymix\Framework\Security::sanitize($dirty_svg, 'svg');
Rhymix\Framework\Storage::write($file_info['tmp_name'], $clean_svg);
}
// Adjust
if(!$manual_insert)
{