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

Broken Select filter if filtering by falsy values #63

Open
mikemix opened this issue Jul 23, 2020 · 1 comment
Open

Broken Select filter if filtering by falsy values #63

mikemix opened this issue Jul 23, 2020 · 1 comment
Labels
Bug Confirmed bugs or bugfixes.

Comments

@mikemix
Copy link

mikemix commented Jul 23, 2020

The Select filter doesn't work for falsey values (like string 0 or simply false), because:

    if (empty($data)) {
        return;
    }

If you ask me, should be:

if (null === $data) {
     return;
}

Or include some kind of allowed_falsy_values[] setting.

@mikemix
Copy link
Author

mikemix commented Aug 5, 2020

I guess this is going partly to work in PHP8 since empty('0') is going to evaluate to false lol.

@lchrusciel lchrusciel added the Bug Confirmed bugs or bugfixes. label Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bugs or bugfixes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants