Skip to content

Error in lengthBetween and lengthMin rule #356

@Sleon4

Description

@Sleon4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions