Form validation for password resets.

Merges [30417] to the 3.9 branch.

Built from https://develop.svn.wordpress.org/branches/3.9@30419


git-svn-id: http://core.svn.wordpress.org/branches/3.9@30414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-11-20 12:23:46 +00:00
parent 3224f9b9c2
commit 05c849b3ee
1 changed files with 4 additions and 0 deletions

View File

@ -574,6 +574,9 @@ case 'rp' :
if ( isset( $_COOKIE[ $rp_cookie ] ) && 0 < strpos( $_COOKIE[ $rp_cookie ], ':' ) ) {
list( $rp_login, $rp_key ) = explode( ':', wp_unslash( $_COOKIE[ $rp_cookie ] ), 2 );
$user = check_password_reset_key( $rp_key, $rp_login );
if ( isset( $_POST['pass1'] ) && ! hash_equals( $rp_key, $_POST['rp_key'] ) ) {
$user = false;
}
} else {
$user = false;
}
@ -643,6 +646,7 @@ case 'rp' :
*/
do_action( 'resetpass_form', $user );
?>
<input type="hidden" name="rp_key" value="<?php echo esc_attr( $rp_key ); ?>" />
<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>
</form>