summaryrefslogtreecommitdiffstats
path: root/wp-includes/html-api/class-wp-html-tag-processor.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-includes/html-api/class-wp-html-tag-processor.php')
-rw-r--r--wp-includes/html-api/class-wp-html-tag-processor.php9
1 files changed, 8 insertions, 1 deletions
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}\"";
}