diff --git a/wp-includes/html-api/class-wp-html-processor.php b/wp-includes/html-api/class-wp-html-processor.php index 3820fe0277..415ff23eea 100644 --- a/wp-includes/html-api/class-wp-html-processor.php +++ b/wp-includes/html-api/class-wp-html-processor.php @@ -786,13 +786,15 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { * or `null` if not matched on any token. */ public function expects_closer( WP_HTML_Token $node = null ): ?bool { - $token_name = $node->node_name ?? $this->get_token_name(); - $token_namespace = $node->namespace ?? $this->get_namespace(); + $token_name = $node->node_name ?? $this->get_token_name(); if ( ! isset( $token_name ) ) { return null; } + $token_namespace = $node->namespace ?? $this->get_namespace(); + $token_has_self_closing = $node->has_self_closing_flag ?? $this->has_self_closing_flag(); + return ! ( // Comments, text nodes, and other atomic tokens. '#' === $token_name[0] || @@ -803,7 +805,7 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor { // Special atomic elements. ( 'html' === $token_namespace && in_array( $token_name, array( 'IFRAME', 'NOEMBED', 'NOFRAMES', 'SCRIPT', 'STYLE', 'TEXTAREA', 'TITLE', 'XMP' ), true ) ) || // Self-closing elements in foreign content. - ( isset( $node ) && 'html' !== $node->namespace && $node->has_self_closing_flag ) + ( 'html' !== $token_namespace && $token_has_self_closing ) ); } 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 fb21c15d1d..95216b08a1 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -2921,7 +2921,7 @@ class WP_HTML_Tag_Processor { return null; } - $namespace = $this->get_namespace(); + $namespace = $this->get_namespace(); $lower_name = strtolower( $attribute_name ); if ( 'math' === $namespace && 'definitionurl' === $lower_name ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 6ec424afb2..2abc0eddf3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58868'; +$wp_version = '6.7-alpha-58870'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.