Making WordPress.org


Ignore:
Timestamp:
09/20/2022 06:25:36 AM (3 years ago)
Author:
dd32
Message:

Login: Check the data type of the passed data, this prevents PHP Notices when junk input is provided to the public login/register forms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/login.php

    r11380 r12075  
    1010// Prefill the username if possible.
    1111$username = $_REQUEST['user'] ?? ( wp_parse_auth_cookie()['username'] ?? '' );
     12if ( ! is_string( $username ) ) {
     13    $username = '';
     14}
    1215
    1316// Redirect is validated at redirect time, just pass through whatever we can.
    14 if ( !empty( $_REQUEST['redirect_to'] ) ) {
     17if ( ! empty( $_REQUEST['redirect_to'] ) ) {
    1518    $redirect = wp_unslash( $_REQUEST['redirect_to'] );
    1619} elseif ( $referer = wp_get_referer() ) {
Note: See TracChangeset for help on using the changeset viewer.