Subject: | Confusing error message when $MAXLEN is false |
The error message when $MAXLEN is set to 0/False is confusing.
Ex.
"Not between 8 and 0 characters"
I have provided a patch to fix this in 1.03.
Thanks, James Saint-Rossy
--- Password.pm.dist Fri Aug 6 15:51:17 2004
+++ Password.pm Fri Aug 6 16:43:11 2004
@@ -102,9 +102,14 @@
sub IsBadPassword {
my $pass = shift;
- return "Not between $MINLEN and $MAXLEN characters"
- if CheckLength($pass);
- return "contains bad characters" if CheckCharset($pass);
+ if (CheckLength($pass)) {
+ if ($MAXLEN && $MINLEN) {
+ return "Not between $MINLEN and $MAXLEN characters";
+ }
+ elsif (!$MAXLEN) { return "Not $MINLEN characters or greater"; }
+ else { return "Not less than or equal to $MAXLEN characters"; }
+ }
+ return "contains bad characters" if CheckCharset($pass);
return "contains less than $GROUPS character groups"
if CheckTypes($pass);
return "contains over $FOLLOWING leading characters in sequence"