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

Feature: add boolean rule #12

Merged
merged 1 commit into from
May 31, 2023
Merged

Feature: add boolean rule #12

merged 1 commit into from
May 31, 2023

Conversation

JasonTheAdams
Copy link
Contributor

This adds a boolean rule that validates and sanitizes. It accepts any value that the FILTER_VALIDATE_BOOLEAN filter allows. This does include some trimming (" yes ") and casing ("YeS"), which I'm a bit on the fence about, but I'm leaning is fine. We can add a strictBoolean in the future if we want something tighter.

Finally, it uses that filter to sanitize the value into a resulting true/false.

@JasonTheAdams
Copy link
Contributor Author

@borkweb Mind giving this one a review when you have a chance? Need it for checkboxes in GiveWP 3.0. 👍

@JasonTheAdams
Copy link
Contributor Author

I force pushed as I realized I had based it off the master branch instead of develop, so I fixed it, cleaning up the commits.

Copy link
Member

@borkweb borkweb left a comment

Choose a reason for hiding this comment

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

This looks good! 👍

@JasonTheAdams JasonTheAdams merged commit 4535809 into develop May 31, 2023
@JasonTheAdams JasonTheAdams deleted the feature/boolean-rule branch May 31, 2023 23:43
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

Successfully merging this pull request may close these issues.

2 participants