diff options
Diffstat (limited to 'modules/user/user.js')
-rw-r--r-- | modules/user/user.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/user/user.js b/modules/user/user.js index 73af27e5d..d182066ad 100644 --- a/modules/user/user.js +++ b/modules/user/user.js @@ -95,10 +95,10 @@ Drupal.behaviors.password = { Drupal.evaluatePasswordStrength = function (password, translate) { var weaknesses = 0, strength = 100, msg = []; - var hasLowercase = password.match(/[a-z]+/); - var hasUppercase = password.match(/[A-Z]+/); - var hasNumbers = password.match(/[0-9]+/); - var hasPunctuation = password.match(/[^a-zA-Z0-9]+/); + var hasLowercase = /[a-z]+/.test(password); + var hasUppercase = /[A-Z]+/.test(password); + var hasNumbers = /[0-9]+/.test(password); + var hasPunctuation = /[^a-zA-Z0-9]+/.test(password); // If there is a username edit box on the page, compare password to that, otherwise // use value from the database. @@ -180,7 +180,7 @@ Drupal.behaviors.fieldUserRegistration = { attach: function (context, settings) { var $checkbox = $('form#field-ui-field-edit-form input#edit-instance-settings-user-register-form'); - if ($checkbox.size()) { + if ($checkbox.length) { $('input#edit-instance-required', context).once('user-register-form-checkbox', function () { $(this).bind('change', function (e) { if ($(this).attr('checked')) { |