Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in lengthBetween and lengthMin rule #356

Open
Sleon4 opened this issue May 5, 2022 · 0 comments
Open

Error in lengthBetween and lengthMin rule #356

Sleon4 opened this issue May 5, 2022 · 0 comments

Comments

@Sleon4
Copy link

Sleon4 commented May 5, 2022

I have been implementing these normal for the validations of a registration form where we depend on the minimum length of a specific string, For example:
identification: "1000000001"

This, when used in standards as the documentation dictates, is as follows:

$rules = [
	'required' => [
		['identification']
	],
	'lengthMin' => [
		['identification', 2]
	]
];

If we look at the rules structure that we are going to use it is correct, but when the information comes in with a string '' it takes it as true and ignores this.
The error implies that lengthBetween and lengthMin are not taking the expected minimum length, accepting that input '' is true when in fact it should be false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant