Skip to content

Commit 9e94297

Browse files
committed
HTML API: Code improvements following [58472].
Props xknown, jorbin. Unprops audrasjb. git-svn-id: https://develop.svn.wordpress.org/trunk@58473 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0479ab3 commit 9e94297

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/html-api/class-wp-html-tag-processor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2980,8 +2980,8 @@ public function set_attribute( $name, $value ) {
29802980
*
29812981
* @see https://html.spec.whatwg.org/#attributes-3
29822982
*/
2983-
$escaped_new_value = esc_attr( $value );
2984-
$updated_attribute = wp_kses_one_attr( "{$comparable_name}=\"{$escaped_new_value}\"", $tag_name );
2983+
$escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes() ) ? esc_url( $value ) : esc_attr( $value );
2984+
$updated_attribute = "{$name}=\"{$escaped_new_value}\"";
29852985
}
29862986

29872987
/*

0 commit comments

Comments
 (0)