Open mlatzko opened 8 years ago
A situation like this should already be covered by the unit tests. You can check against the php7
branch which has the most up-to-date development version of the code?
I already take the pre-release 2.0.0. which seems to be based on the branch php7 isnt it?
see: https://github.com/fuelphp/validation/blob/php7/src/Validator.php#L253
It's been a while since I have had a chance to do any proper work so I could not remember what state the 2.0 pre-release was in. the php7
branch is indeed based off that.
This should be solved by #53
Code causing the issue
See: https://github.com/fuelphp/validation/blob/php7/src/Validator.php#L253
Description
The condition to populate $dataPresent will be set to false value because an "empty(false)" is true. This leads to further issue because the value of the field becomes transformed from "false" to "null". This than leads to issues with rules based on "null" interpretation like "Fuel\Validation\Rule\Required". The problem only occurs while a value of a field is Boolean "false".
Example
Possible solution (adding check for Boolean values)