From d5a951c2ebb0910aabb5598cf115fedceb40e521 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Wed, 7 Jan 2026 14:36:28 -0600 Subject: [PATCH] Sanitize SVGs when uploaded to the theme assets (cherry picked from commit 8a7f74b004fcd19721764fc63af0cdb339d9fb65) --- modules/cms/widgets/AssetList.php | 46 +++++++++++++++++++------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/modules/cms/widgets/AssetList.php b/modules/cms/widgets/AssetList.php index 5cc92e1314..39a9172c3b 100644 --- a/modules/cms/widgets/AssetList.php +++ b/modules/cms/widgets/AssetList.php @@ -1,22 +1,25 @@ -getRealPath(), Svg::extract($uploadedFile->getRealPath())); + } + /* * Accept the uploaded file */ - $uploadedFile = $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName()); + $uploadedFile = $uploadedFile->move($this->getCurrentPath(), $fileName); File::chmod($uploadedFile->getRealPath());