Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ define([
this.options.cache.label = $(this.options.passwordStrengthMeterLabelSelector, this.element);

// We need to look outside the module for backward compatibility, since someone can already use the module.
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the the email field from the
// newsletter email field or any other "email" field.
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
this._bind();
},
Expand Down Expand Up @@ -74,7 +76,9 @@ define([
'password-not-equal-to-user-name': this.options.cache.email.val()
});

if (password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
// We should only perform this check in case there is an email field on screen
if (this.options.cache.email.length &&
password.toLowerCase() === this.options.cache.email.val().toLowerCase()) {
displayScore = 1;
} else {
isValid = $.validator.validateSingleElement(this.options.cache.input);
Expand Down