sub queryLoginPinCode bug

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderators: Moderators, Developers

Message
Author
DrKN
Developers
Developers
Posts: 79
Joined: 06 Oct 2010, 09:22
Noob?: No

sub queryLoginPinCode bug

#1 Post by DrKN »

There is a bug in this sub.

Code: Select all

sub queryLoginPinCode {
	my $message = $_[0] || T("You've never set a login PIN code before.\nPlease enter a new login PIN code:");
	do {
		my $input = $interface->query($message, isPassword => 1,);
		if (!defined($input)) {
			quit();
			return;
		} else {
			if ($input !~ /^\d+$/) {
				$interface->errorDialog(T("The PIN code may only contain digits."));
			} elsif ((length($input) <= 3) || (length($input) >= 9)) {
				$interface->errorDialog(T("The PIN code must be between 4 and 9 characters."));
			} else {
				return $input;
			}
		}
	} while (1);
}
When we type the password length <4 or >9
it will give us a error dialog.
but then loop back to

Code: Select all

my $input = $interface->query($message, isPassword => 1,);
the condition under it becomes true..

Code: Select all

if (!defined($input)) {
			quit();
			return;
		}
i cant sure the problem is...
it is defined above it but the condition returns true.

Locked