Skip to content

Commit ac78ea4

Browse files
committed
Bugfix in the common password rule
1 parent 9d99bc4 commit ac78ea4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.2.1dev
4+
5+
- Bugfix in the common passwords rule.
6+
37
## 2.2.0
48

59
- Add new rule to penalize common passwords.

src/rules.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ try {
148148
};
149149

150150
validation.wordIsACommonPassword = function (options, word, score) {
151-
return ($.inArray(word, options.rules.commonPasswords) >= 0) && score;
151+
if ($.inArray(word, options.rules.commonPasswords) >= 0) {
152+
return score;
153+
}
154+
return 0;
152155
};
153156

154157
rulesEngine.validation = validation;

0 commit comments

Comments
 (0)