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

Fix validation regarding multiple() and valid 0 value. #6814

Merged
merged 1 commit into from
Jun 15, 2015

Conversation

dereuromark
Copy link
Member

Follow up on #6813
The validation also removes '0' where it shouldn't as the form values could very well be a valid 0 value.

@dereuromark dereuromark added this to the 3.0.8 milestone Jun 15, 2015
@@ -654,7 +654,9 @@ public static function multiple($check, array $options = [], $caseInsensitive =
$defaults = ['in' => null, 'max' => null, 'min' => null];
$options += $defaults;

$check = array_filter((array)$check);
$check = array_filter((array)$check, function ($value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually write array_filter($value, 'strlen')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nano-optimization probably to not use strlen(), I am fine changing if you prefer.

markstory added a commit that referenced this pull request Jun 15, 2015
Fix validation regarding multiple() and valid 0 value.
@markstory markstory merged commit c29c9e0 into master Jun 15, 2015
@markstory
Copy link
Member

Given how frequently Validation::multiple() is used, the current code will be fine.

@markstory markstory deleted the master-validation-fix branch June 15, 2015 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants