From edd34df6eab0506e392f065daff90604bd0c9079 Mon Sep 17 00:00:00 2001 From: dmsnell Date: Wed, 14 Aug 2024 19:51:17 +0000 Subject: [PATCH] HTML API: Use strict in_array comparison for checking URI attributes. This patch modifies the URL-escaping code in the HTML API to rely on strict comparisons. This prevents accidental matching via type-coercion. Developed in https://github.com/wordpress/wordpress-develop/pull/7196 Follow-up to [58473]. Props jonsurrell. Built from https://develop.svn.wordpress.org/trunk@58897 git-svn-id: http://core.svn.wordpress.org/trunk@58293 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-tag-processor.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 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 11a0daa4b2..e6e704e71c 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -3667,7 +3667,7 @@ class WP_HTML_Tag_Processor { * * @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 ); + $escaped_new_value = in_array( $comparable_name, wp_kses_uri_attributes(), true ) ? esc_url( $value ) : esc_attr( $value ); // If the escaping functions wiped out the update, reject it and indicate it was rejected. if ( '' === $escaped_new_value && '' !== $value ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 25f1c56912..dbf405e476 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58896'; +$wp_version = '6.7-alpha-58897'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.