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

Required rule bug #52

Open
Delpfine opened this issue Jul 24, 2016 · 0 comments
Open

Required rule bug #52

Delpfine opened this issue Jul 24, 2016 · 0 comments

Comments

@Delpfine
Copy link

Delpfine commented Jul 24, 2016

Field 'cnn' range in 0 to 9, if field cnn=0 get error The field is required and has not been specified.

$val->addField('cnn')
            ->number()
            ->required()
            ->numericMax('9')
            ->numericMin('0');

Bug in /vendor/fuelphp/validation/src/Rule/Required.php line 53
return ($value === 0 or $value === false or ! empty($value));

phpDoc Note:

No warning is generated if the variable does not exist. That means empty() is essentially the concise equivalent to !isset($var) || $var == false.

Delpfine added a commit to Delpfine/validation that referenced this issue Jul 24, 2016
@emlynwest emlynwest mentioned this issue Jul 24, 2016
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