Make WordPress Core

Ticket #58102: 58102-general-template.diff

File 58102-general-template.diff, 1.3 KB (added by viralsampat, 3 years ago)
  • src/wp-includes/general-template.php

    diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
    index 9cae9b930d..c37b71b75d 100644
    a b function get_search_form( $args = array() ) {  
    355355        }
    356356
    357357        if ( $args['echo'] ) {
    358                 echo $result;
     358                echo esc_html( $result );
    359359        } else {
    360                 return $result;
     360                return esc_html( $result );
    361361        }
    362362}
    363363
    function wp_login_form( $args = array() ) {  
    512512        $defaults = array(
    513513                'echo'           => true,
    514514                // Default 'redirect' value takes the user back to the request URI.
    515                 'redirect'       => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
     515                'redirect'       => ( is_ssl() ? 'https://' : 'http://' ) . sanitize_text_field( $_SERVER['HTTP_HOST'] ) . sanitize_text_field( $_SERVER['REQUEST_URI'] ),
    516516                'form_id'        => 'loginform',
    517517                'label_username' => __( 'Username or Email Address' ),
    518518                'label_password' => __( 'Password' ),
    function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {  
    705705        $link = apply_filters( 'register', $link );
    706706
    707707        if ( $echo ) {
    708                 echo $link;
     708                echo esc_html( $link );
    709709        } else {
    710                 return $link;
     710                return esc_html( $link );
    711711        }
    712712}
    713713