mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-03 12:14:25 +00:00
Users: Check zxcvbn is defined before calling.
Prevents JavaScript errors by checking zxcvbn is defined before calling. Changes `wp.passwordStrength.meter()` to return `-1` if the strength of the password is unknown. On the user profile screen, `generatePassword()` checks if the user has entered the password before setting the value of the password input box. Props peterwilsoncc, adamsilverstein. Fixes #34905. git-svn-id: https://develop.svn.wordpress.org/trunk@37940 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -380,6 +380,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
|
||||
'unknown' => _x( 'Password strength unknown', 'password strength' ),
|
||||
'short' => _x( 'Very weak', 'password strength' ),
|
||||
'bad' => _x( 'Weak', 'password strength' ),
|
||||
'good' => _x( 'Medium', 'password strength' ),
|
||||
@@ -390,6 +391,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter', 'wp-util' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array(
|
||||
'warn' => __( 'Your new password has not been saved.' ),
|
||||
'warnWeak' => __( 'Confirm use of weak password.' ),
|
||||
'show' => __( 'Show' ),
|
||||
'hide' => __( 'Hide' ),
|
||||
'cancel' => __( 'Cancel' ),
|
||||
|
||||
Reference in New Issue
Block a user