Make WordPress Core

Changeset 50661


Ignore:
Timestamp:
04/06/2021 03:40:38 AM (3 years 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.
Merges [50575] to the 5.7 branch.
Fixes #52894.

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/src/wp-includes/script-loader.php

    r50420 r50661  
    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.