From 7f66ecb974a479352bc898c1f2120127335b2673 Mon Sep 17 00:00:00 2001 From: scruffian Date: Thu, 30 Mar 2023 16:16:35 +0100 Subject: [PATCH] KSES: Remove the filter that makes filter a safe attribute --- lib/experimental/kses.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/lib/experimental/kses.php b/lib/experimental/kses.php index 1138aa67933ef..ff0de662c5da5 100644 --- a/lib/experimental/kses.php +++ b/lib/experimental/kses.php @@ -66,28 +66,6 @@ function gutenberg_override_core_kses_init_filters() { add_action( 'init', 'gutenberg_override_core_kses_init_filters', 20 ); add_action( 'set_current_user', 'gutenberg_override_core_kses_init_filters' ); -/** - * See https://github.com/WordPress/wordpress-develop/pull/4108 - * - * Mark CSS safe if it contains a "filter: url('#wp-duotone-...')" rule. - * - * This function should not be backported to core. - * - * @param bool $allow_css Whether the CSS is allowed. - * @param string $css_test_string The CSS to test. - */ -function allow_filter_in_styles( $allow_css, $css_test_string ) { - if ( preg_match( - "/^filter:\s*url\('#wp-duotone-[-a-zA-Z0-9]+'\) !important$/", - $css_test_string - ) ) { - return true; - } - return $allow_css; -} - -add_filter( 'safecss_filter_attr_allow_css', 'allow_filter_in_styles', 10, 2 ); - /** * Mark CSS safe if it contains grid functions *