Make WordPress Core

Changeset 61052


Ignore:
Timestamp:
10/22/2025 10:31:58 PM (7 weeks ago)
Author:
westonruter
Message:

Script Loader: Fix logic inversion with $html5_script_support in wp_sanitize_script_attributes().

The value was actually whether HTML5 was not supported.

Follow-up to [50167].

Props jamieburchell, sabernhardt.
See #39941.
Fixes #64128.

File:
1 edited

Legend:

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

    r61022 r61052  
    28702870 */
    28712871function wp_sanitize_script_attributes( $attributes ) {
    2872     $html5_script_support = ! is_admin() && ! current_theme_supports( 'html5', 'script' );
     2872    $html5_script_support = is_admin() || current_theme_supports( 'html5', 'script' );
    28732873    $attributes_string    = '';
    28742874
     
    28802880        if ( is_bool( $attribute_value ) ) {
    28812881            if ( $attribute_value ) {
    2882                 $attributes_string .= $html5_script_support ? sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) ) : ' ' . esc_attr( $attribute_name );
     2882                $attributes_string .= $html5_script_support ? ' ' . esc_attr( $attribute_name ) : sprintf( ' %1$s="%2$s"', esc_attr( $attribute_name ), esc_attr( $attribute_name ) );
    28832883            }
    28842884        } else {
Note: See TracChangeset for help on using the changeset viewer.