Make WordPress Core

Ticket #58831: 58831-add-missing-escape-wp-includes.patch

File 58831-add-missing-escape-wp-includes.patch, 1.8 KB (added by viralsampat, 3 months ago)
  • src/wp-includes/general-template.php

    diff --git src/wp-includes/general-template.php src/wp-includes/general-template.php
    index a2b1029064..627311772d 100644
    function _wp_render_title_tag() { 
    12991299                return;
    13001300        }
    13011301
    1302         echo '<title>' . wp_get_document_title() . '</title>' . "\n";
     1302        echo '<title>' . esc_html( wp_get_document_title() ) . '</title>' . "\n";
    13031303}
    13041304
    13051305/**
  • src/wp-includes/load.php

    diff --git src/wp-includes/load.php src/wp-includes/load.php
    index 3db556583c..bfda00cd14 100644
    function timer_stop( $display = 0, $precision = 3 ) { 
    495495        }
    496496
    497497        if ( $display ) {
    498                 echo $r;
     498                echo esc_html( $r );
    499499        }
    500500
    501501        return $r;
  • src/wp-includes/theme-compat/header.php

    diff --git src/wp-includes/theme-compat/header.php src/wp-includes/theme-compat/header.php
    index cbd84eb20e..264c5389ea 100644
    _deprecated_file( 
    2121<link rel="profile" href="https://gmpg.org/xfn/11" />
    2222<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
    2323
    24 <title><?php echo wp_get_document_title(); ?></title>
     24<title><?php echo esc_html( wp_get_document_title() ); ?></title>
    2525
    2626<link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" media="screen" />
    2727<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    if ( is_singular() ) { 
    5454
    5555<div id="header" role="banner">
    5656        <div id="headerimg">
    57                 <h1><a href="<?php echo home_url(); ?>/"><?php bloginfo( 'name' ); ?></a></h1>
     57                <h1><a href="<?php echo esc_url( home_url() ); ?>/"><?php bloginfo( 'name' ); ?></a></h1>
    5858                <div class="description"><?php bloginfo( 'description' ); ?></div>
    5959        </div>
    6060</div>