From e4c60b56d47df1554adc6d978a391e28627b8f84 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Fri, 20 Feb 2026 21:57:35 +0900 Subject: [PATCH] Add unit tests for Security::sanitize() supporting SVG --- tests/unit/framework/SecurityTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/framework/SecurityTest.php b/tests/unit/framework/SecurityTest.php index 4246316be..9fb35a2b0 100644 --- a/tests/unit/framework/SecurityTest.php +++ b/tests/unit/framework/SecurityTest.php @@ -15,6 +15,16 @@ class SecurityTest extends \Codeception\Test\Unit // Filename (more thorough tests in FilenameFilterTest) $this->assertEquals('foo(bar).xls', Rhymix\Framework\Security::sanitize('foo.xls', 'filename')); + + // SVG #1 + $source = 'Test'; + $target = '' . "\n\n \n Test\n \n\n"; + $this->assertEquals($target, Rhymix\Framework\Security::sanitize($source, 'svg')); + + // SVG #2 + $source = ''; + $target = '' . "\n\n \n\n"; + $this->assertEquals($target, Rhymix\Framework\Security::sanitize($source, 'svg')); } public function testEncryption()