Make WordPress Core

Ticket #61125: some-feature.61125.diff

File some-feature.61125.diff, 3.1 KB (added by yagniksangani, 2 years ago)

Added escaping for some Strings and URLs

  • src/wp-activate.php

    diff --git a/src/wp-activate.php b/src/wp-activate.php
    index ff71779036..2016fafe30 100644
    a b $blog_details = get_blog_details();  
    127127        <?php if ( ! $key ) { ?>
    128128
    129129                <h2><?php _e( 'Activation Key Required' ); ?></h2>
    130                 <form name="activateform" id="activateform" method="post" action="<?php echo network_site_url( $blog_details->path . 'wp-activate.php' ); ?>">
     130                <form name="activateform" id="activateform" method="post" action="<?php echo esc_url( network_site_url( $blog_details->path . 'wp-activate.php' ) ); ?>">
    131131                        <p>
    132132                                <label for="key"><?php _e( 'Activation Key:' ); ?></label>
    133133                                <br /><input type="text" name="key" id="key" value="" size="50" />
    $blog_details = get_blog_details();  
    179179                        <h2><?php _e( 'Your account is now active!' ); ?></h2>
    180180
    181181                        <div id="signup-welcome">
    182                         <p><span class="h3"><?php _e( 'Username:' ); ?></span> <?php echo $user->user_login; ?></p>
    183                         <p><span class="h3"><?php _e( 'Password:' ); ?></span> <?php echo $result['password']; ?></p>
     182                        <p><span class="h3"><?php _e( 'Username:' ); ?></span> <?php esc_html_e( $user->user_login ); ?></p>
     183                        <p><span class="h3"><?php _e( 'Password:' ); ?></span> <?php esc_html_e( $result['password'] ); ?></p>
    184184                        </div>
    185185
    186186                        <?php
  • src/wp-links-opml.php

    diff --git a/src/wp-links-opml.php b/src/wp-links-opml.php
    index 9739a9a767..95b3926786 100644
    a b echo '<?xml version="1.0"?' . ">\n";  
    3333                        printf( __( 'Links for %s' ), esc_attr( get_bloginfo( 'name', 'display' ) ) );
    3434                ?>
    3535                </title>
    36                 <dateCreated><?php echo gmdate( 'D, d M Y H:i:s' ); ?> GMT</dateCreated>
     36                <dateCreated><?php esc_html_e( gmdate( 'D, d M Y H:i:s' ) ); ?> GMT</dateCreated>
    3737                <?php
    3838                /**
    3939                 * Fires in the OPML header.
    foreach ( (array) $cats as $cat ) :  
    8383<outline text="<?php echo esc_attr( $title ); ?>" type="link" xmlUrl="<?php echo esc_attr( $bookmark->link_rss ); ?>" htmlUrl="<?php echo esc_attr( $bookmark->link_url ); ?>" updated="
    8484                                                        <?php
    8585                                                        if ( '0000-00-00 00:00:00' !== $bookmark->link_updated ) {
    86                                                                 echo $bookmark->link_updated;}
     86                                                                esc_html_e( $bookmark->link_updated );}
    8787                                                        ?>
    8888" />
    8989                <?php
  • src/wp-login.php

    diff --git a/src/wp-login.php b/src/wp-login.php
    index b7c14b4c83..8d9781cca7 100644
    a b function login_header( $title = 'Log In', $message = '', $wp_error = null ) {  
    9090        <html <?php language_attributes(); ?>>
    9191        <head>
    9292        <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
    93         <title><?php echo $login_title; ?></title>
     93        <title><?php esc_html_e( $login_title ); ?></title>
    9494        <?php
    9595
    9696        wp_enqueue_style( 'login' );
    function login_header( $title = 'Log In', $message = '', $wp_error = null ) {  
    206206
    207207        ?>
    208208        <div id="login">
    209                 <h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
     209                <h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php esc_html_e( $login_header_text ); ?></a></h1>
    210210        <?php
    211211        /**
    212212         * Filters the message to display above the login form.