Login and Registration: reset password - ensure submit button disabled when field empty.

Fix an issue where the submit button was enabled with an empty password when the user previously checked "Confirm use of weak password" for a weak password, then cleared the password field.

Props henry.wright.
Fixes #47924.


Built from https://develop.svn.wordpress.org/trunk@46103


git-svn-id: http://core.svn.wordpress.org/trunk@45915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2019-09-13 18:30:55 +00:00
parent 7bbce99655
commit a3eba2c201
3 changed files with 10 additions and 5 deletions

View File

@ -272,9 +272,9 @@
function check_pass_strength() {
var pass1 = $('#pass1').val(), strength;
$('#pass-strength-result').removeClass('short bad good strong');
$('#pass-strength-result').removeClass('short bad good strong empty');
if ( ! pass1 ) {
$('#pass-strength-result').html( ' ' );
$( '#pass-strength-result' ).addClass( 'empty' ).html( ' ' );
return;
}
@ -311,8 +311,13 @@
$submitButtons.prop( 'disabled', true );
}
$weakRow.show();
} else {
if ( $( passStrength ).is( '.empty' ) ) {
$submitButtons.prop( 'disabled', true );
$weakCheckbox.prop( 'checked', false );
} else {
$submitButtons.prop( 'disabled', false );
}
$weakRow.hide();
}
}

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-alpha-46102';
$wp_version = '5.3-alpha-46103';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.