WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/01/2016 12:44:43 PM (4 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r37914 r37940  
    381381    $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array( 'jquery', 'zxcvbn-async' ), false, 1 );
    382382    did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
     383        'unknown'  => _x( 'Password strength unknown', 'password strength' ),
    383384        'short'    => _x( 'Very weak', 'password strength' ),
    384385        'bad'      => _x( 'Weak', 'password strength' ),
     
    391392    did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array(
    392393        'warn'     => __( 'Your new password has not been saved.' ),
     394        'warnWeak' => __( 'Confirm use of weak password.' ),
    393395        'show'     => __( 'Show' ),
    394396        'hide'     => __( 'Hide' ),
Note: See TracChangeset for help on using the changeset viewer.