From 15d31bc417c72e517aeebe965170698fd9b2c8ad Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Thu, 17 Nov 2022 16:01:47 +0000 Subject: [PATCH] Issue #3321945 by Spokje: Remove PHP < 5.4.0 checks --- .../tests/src/Unit/EditorXssFilter/StandardTest.php | 8 -------- core/tests/Drupal/Tests/Component/Utility/XssTest.php | 10 ---------- 2 files changed, 18 deletions(-) diff --git a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php index d3a52071275b..bccd8c4c6ba0 100644 --- a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php +++ b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php @@ -145,14 +145,6 @@ public function providerTestFilterXss() { // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Null_breaks_up_JavaScript_directive $data[] = ["<IMG SRC=java\0script:alert(\"XSS\")>", '<IMG>']; - // Spaces and meta chars before the JavaScript in images for XSS. - // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Spaces_and_meta_chars_before_the_JavaScript_in_images_for_XSS - // @todo This dataset currently fails under 5.4 because of - // https://www.drupal.org/node/1210798. Restore after it's fixed. - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $data[] = ['<IMG SRC="  javascript:alert(\'XSS\');">', '<IMG src="alert('XSS');">']; - } - // Non-alpha-non-digit XSS. // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Non-alpha-non-digit_XSS $data[] = ['<SCRIPT/XSS SRC="http://ha.ckers.org/xss.js"></SCRIPT>', '']; diff --git a/core/tests/Drupal/Tests/Component/Utility/XssTest.php b/core/tests/Drupal/Tests/Component/Utility/XssTest.php index 9f492f80d839..1da42c2c74da 100644 --- a/core/tests/Drupal/Tests/Component/Utility/XssTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/XssTest.php @@ -433,16 +433,6 @@ public function providerTestFilterXssNotNormalized() { ['p'], ], ]; - // @todo This dataset currently fails under 5.4 because of - // https://www.drupal.org/node/1210798. Restore after its fixed. - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - $cases[] = [ - '<img src="  javascript:alert(0)">', - 'javascript', - 'HTML scheme clearing evasion -- spaces and metacharacters before scheme.', - ['img'], - ]; - } return $cases; } -- GitLab