From 3ce72ee99bc230c3df10841a69d0ff243eb1a0bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 1 Jul 2024 20:08:41 +0200 Subject: Adding upstream version 6.5.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/html-api/class-wp-html-tag-processor.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'wp-includes/html-api/class-wp-html-tag-processor.php') diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php index c540ea9..bf7e026 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -2968,7 +2968,14 @@ class WP_HTML_Tag_Processor { if ( true === $value ) { $updated_attribute = $name; } else { - $escaped_new_value = esc_attr( $value ); + $comparable_name = strtolower( $name ); + + /* + * Escape URL attributes. + * + * @see https://html.spec.whatwg.org/#attributes-3 + */ + $escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes() ) ? esc_url( $value ) : esc_attr( $value ); $updated_attribute = "{$name}=\"{$escaped_new_value}\""; } -- cgit v1.2.3