Skip Menu |

This queue is for tickets about the Data-Password CPAN distribution.

Report information
The Basics
Id: 7280
Status: resolved
Priority: 0/
Queue: Data-Password

People
Owner: Nobody in particular
Requestors: james [...] saint-rossy.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.03
Fixed in: (no value)



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"
Hi, I've applied your patch to version 1.03 and created version 1.04 I've uploaded 1.04 few minutes ago (see Changes file and test.pl). Thanks Oded S. Resnik