Make WordPress Core


Ignore:
Timestamp:
08/27/2024 03:35:35 AM (2 years ago)
Author:
dmsnell
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r58926 r58940  
    47054705        public function get_namespace(): string {
    47064706                if ( ! isset( $this->current_element ) ) {
    4707                         return 'html';
     4707                        return parent::get_namespace();
    47084708                }
    47094709
Note: See TracChangeset for help on using the changeset viewer.