diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php index cc88455bc1..f63517f7e1 100644 --- a/wp-includes/class.wp-scripts.php +++ b/wp-includes/class.wp-scripts.php @@ -227,7 +227,7 @@ class WP_Scripts extends WP_Dependencies { return $output; } - echo "type_attr}>\n"; + printf( "\n", $this->type_attr, esc_attr( $handle ) ); // CDATA is not needed for HTML 5. if ( $this->type_attr ) { @@ -298,11 +298,11 @@ class WP_Scripts extends WP_Dependencies { $after_handle = $this->print_inline_script( $handle, 'after', false ); if ( $before_handle ) { - $before_handle = sprintf( "\n%s\n\n", $this->type_attr, $before_handle ); + $before_handle = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $before_handle ); } if ( $after_handle ) { - $after_handle = sprintf( "\n%s\n\n", $this->type_attr, $after_handle ); + $after_handle = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $after_handle ); } if ( $before_handle || $after_handle ) { @@ -366,7 +366,7 @@ class WP_Scripts extends WP_Dependencies { $translations = $this->print_translations( $handle, false ); if ( $translations ) { - $translations = sprintf( "\n%s\n\n", $this->type_attr, $translations ); + $translations = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $translations ); } if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { @@ -385,7 +385,7 @@ class WP_Scripts extends WP_Dependencies { } $tag = $translations . $cond_before . $before_handle; - $tag .= sprintf( "\n", $this->type_attr, $src ); + $tag .= sprintf( "\n", $this->type_attr, $src, esc_attr( $handle ) ); $tag .= $after_handle . $cond_after; /** @@ -458,7 +458,7 @@ class WP_Scripts extends WP_Dependencies { $output = trim( implode( "\n", $output ), "\n" ); if ( $echo ) { - printf( "\n%s\n\n", $this->type_attr, $output ); + printf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output ); } return $output; @@ -595,7 +595,7 @@ class WP_Scripts extends WP_Dependencies { JS; if ( $echo ) { - printf( "\n%s\n\n", $this->type_attr, $output ); + printf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $output ); } return $output; diff --git a/wp-includes/version.php b/wp-includes/version.php index 6e9d15eb90..c91379bccf 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48294'; +$wp_version = '5.5-alpha-48295'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.