WordPress.org

Make WordPress Core

Changeset 50575


Ignore:
Timestamp:
03/25/2021 12:25:37 AM (4 months ago)
Author:
peterwilsoncc
Message:

Script Loader: Escape HTML5 boolean attribute names.

Add escaping of boolean attribute names in wp_sanitize_script_attributes() for themes supporting HTML5 script elements.

Props tmatsuur, johnbillion, joyously.
Fixes #52894.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r50420 r50575  
    23542354        if ( is_bool( $attribute_value ) ) {
    23552355            if ( $attribute_value ) {
    2356                 $attributes_string .= $html5_script_support ? sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) ) : ' ' . $attribute_name;
     2356                $attributes_string .= $html5_script_support ? sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) ) : ' ' . esc_attr( $attribute_name );
    23572357            }
    23582358        } else {
Note: See TracChangeset for help on using the changeset viewer.