From 813d784931e6e9437943e34264ed1c77320289b5 Mon Sep 17 00:00:00 2001 From: dmsnell Date: Tue, 27 Aug 2024 03:37:12 +0000 Subject: [PATCH] HTML API: Fix a bug where the namespace was forced to 'html' While working on other reviews and audits, a bug was discovered in the HTML API where the wrong namespace was being assigned to a token because the default value of 'html' was used. This patch fixes the bug by calling the `parent::get_namespace()` method instead of assuming 'html'. Developed in https://github.com/wordpress/wordpress-develop/7232 Discussed in https://core.trac.wordpress.org/ticket/61576 Follow-up to [58868]. Props jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@58940 git-svn-id: http://core.svn.wordpress.org/trunk@58336 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/html-api/class-wp-html-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-processor.php b/wp-includes/html-api/class-wp-html-processor.php index 168b8ace4c..d6df280f35 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -4704,7 +4704,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { */ public function get_namespace(): string { if ( ! isset( $this->current_element ) ) { - return 'html'; + return parent::get_namespace(); } return $this->current_element->token->namespace; diff --git a/wp-includes/version.php b/wp-includes/version.php index 285098a2a0..89f32f60e3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58939'; +$wp_version = '6.7-alpha-58940'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.