WordPress.org

Make WordPress Core

Changeset 30419


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

Form validation for password resets.

Merges [30417] to the 3.9 branch.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

  • branches/3.9/src/wp-login.php

    r29638 r30419  
    575575        list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
    576576        $user = check_password_reset_key( $rp_key, $rp_login );
     577        if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
     578            $user = false;
     579        }
    577580    } else {
    578581        $user = false;
     
    644647    do_action( 'resetpass_form', $user );
    645648    ?>
     649    <input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
    646650    <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>
    647651</form>
Note: See TracChangeset for help on using the changeset viewer.