diff --git a/core/modules/editor/src/EditorXssFilter/Standard.php b/core/modules/editor/src/EditorXssFilter/Standard.php index aed9f29..43ef797 100644 --- a/core/modules/editor/src/EditorXssFilter/Standard.php +++ b/core/modules/editor/src/EditorXssFilter/Standard.php @@ -97,6 +97,12 @@ public static function filterXss($html, FilterFormatInterface $format, FilterFor /** * Applies a very permissive XSS/HTML filter to data-attributes. + * + * @param string $html + * The string to apply the data-attributes filtering to. + * + * @return string + * The filtered string. */ protected static function filterXssDataAttributes($html) { if (stristr($html, 'data-') !== FALSE) { diff --git a/core/modules/filter/src/Tests/FilterUnitTest.php b/core/modules/filter/src/Tests/FilterUnitTest.php index 7a55beb..d2b515b 100644 --- a/core/modules/filter/src/Tests/FilterUnitTest.php +++ b/core/modules/filter/src/Tests/FilterUnitTest.php @@ -232,8 +232,7 @@ function testCaptionFilter() { $input = ''; $expected = '
Source:Wikipedia
'; $this->assertIdentical($expected, $test_with_html_filter($input)); - $expected_xss_filtered = ''; - $this->assertIdentical($expected_xss_filtered, $test_editor_xss_filter($input)); + $this->assertIdentical($input, $test_editor_xss_filter($input)); // A pretty crazy edge case where we have two colons. $input = '';