WordPress.org

Make WordPress Core

Changeset 30417


Ignore:
Timestamp:
11/20/2014 12:21:45 PM (5 years ago)
Author:
nacin
Message:

Form validation for password resets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r30357 r30417  
    577577        list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
    578578        $user = check_password_reset_key( $rp_key, $rp_login );
     579        if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
     580            $user = false;
     581        }
    579582    } else {
    580583        $user = false;
     
    645648    do_action( 'resetpass_form', $user );
    646649    ?>
     650    <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
    647651    <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e('Reset Password'); ?>" /></p>
    648652</form>
Note: See TracChangeset for help on using the changeset viewer.