Make WordPress Core

Ticket #58102: 58102.2.diff

File 58102.2.diff, 1.5 KB (added by viralsampat, 3 years ago)

I have checked above mentioned issue and I have resolved it and added patch.

  • src/wp-includes/admin-bar.php

    diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php
    index 19322a3451..ddcbcdf007 100644
    a b function wp_admin_bar_customize_menu( $wp_admin_bar ) {  
    463463                return;
    464464        }
    465465
    466         $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     466        $current_url = ( is_ssl() ? 'https://' : 'http://' ) . sanitize_text_field( $_SERVER['HTTP_HOST'] ) . sanitize_text_field( $_SERVER['REQUEST_URI'] );
    467467        if ( is_customize_preview() && $wp_customize->changeset_uuid() ) {
    468468                $current_url = remove_query_arg( 'customize_changeset_uuid', $current_url );
    469469        }
    function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) {  
    11981198function wp_admin_bar_header() {
    11991199        $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
    12001200        ?>
    1201 <style<?php echo $type_attr; ?> media="print">#wpadminbar { display:none; }</style>
     1201<style<?php echo esc_attr( $type_attr ); ?> media="print">#wpadminbar { display:none; }</style>
    12021202        <?php
    12031203}
    12041204
    function wp_admin_bar_header() {  
    12101210function _admin_bar_bump_cb() {
    12111211        $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"';
    12121212        ?>
    1213 <style<?php echo $type_attr; ?> media="screen">
     1213<style<?php echo esc_attr( $type_attr ); ?> media="screen">
    12141214        html { margin-top: 32px !important; }
    12151215        @media screen and ( max-width: 782px ) {
    12161216                html { margin-top: 46px !important; }