Make WordPress Core

Changeset 63067


Ignore:
Timestamp:
08/06/2026 03:44:18 PM (2 months ago)
Author:
johnbillion
Message:

Users: Prevent usernames from mangling HTML.

Props peterwilsoncc, westonruter, batmoo, xknown, jeremyfelt, lancewillett, lucasbustamante, johnbillion, jorbin, dmsnell.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r63065 r63067  
    187187                                /* translators: %s: User name. */
    188188                                __( '<strong>Error:</strong> The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ),
    189                                 $username
     189                                esc_html( $username )
    190190                        )
    191191                );
    … …  
    214214                                /* translators: %s: User name. */
    215215                                __( '<strong>Error:</strong> The password you entered for the username %s is incorrect.' ),
    216                                 '<strong>' . $username . '</strong>'
     216                                '<strong>' . esc_html( $username ) . '</strong>'
    217217                        ) .
    218218                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    297297                                /* translators: %s: Email address. */
    298298                                __( '<strong>Error:</strong> The password you entered for the email address %s is incorrect.' ),
    299                                 '<strong>' . $email . '</strong>'
     299                                '<strong>' . esc_html( $email ) . '</strong>'
    300300                        ) .
    301301                        ' <a href="' . wp_lostpassword_url() . '">' .
    … …  
    35883588                                /* translators: %s: Link to the login page. */
    35893589                                __( '<strong>Error:</strong> This email address is already registered. <a href="%s">Log in</a> with this address or choose another one.' ),
    3590                                 wp_login_url()
     3590                                esc_url( wp_login_url() )
    35913591                        )
    35923592                );
    … …  
    36363636                                /* translators: %s: Admin email address. */
    36373637                                __( '<strong>Error:</strong> Could not register you&hellip; please contact the <a href="mailto:%s">site admin</a>!' ),
    3638                                 get_option( 'admin_email' )
     3638                                esc_attr( get_option( 'admin_email' ) )
    36393639                        )
    36403640                );
  • trunk/src/wp-login.php

    r62741 r63067  
    12151215                                        /* translators: %s: Link to the login page. */
    12161216                                        __( 'Check your email for the confirmation link, then visit the <a href="%s">login page</a>.' ),
    1217                                         wp_login_url()
     1217                                        esc_url( wp_login_url() )
    12181218                                ),
    12191219                                'message'
    … …  
    12251225                                        /* translators: %s: Link to the login page. */
    12261226                                        __( 'Registration complete. Please check your email, then visit the <a href="%s">login page</a>.' ),
    1227                                         wp_login_url()
     1227                                        esc_url( wp_login_url() )
    12281228                                ),
    12291229                                'message'
Note: See TracChangeset for help on using the changeset viewer.