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

Update Feature settings validation and defaults #774

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

joshcanhelp
Copy link
Contributor

Description

  • Normalize settings validation for the Features tab
  • Normalize defaults for the Features tab

References

WP guidance on sanitization and escaping

Testing

  • This change improves test coverage for new/changed/fixed functionality

@joshcanhelp joshcanhelp requested a review from a team January 31, 2020 19:46
protected function sanitize_switch_val( $val ) {
return in_array( $val, [ 1, '1', true ] ) ? true : false;
return in_array( $val, [ 1, '1', true ], true ) ? true : false;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes the check strict so $val is not casted in any way.

@joshcanhelp joshcanhelp added this to the 4.0.0 milestone Jan 31, 2020
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

Go

@joshcanhelp joshcanhelp merged commit c0ebd9d into master Jan 31, 2020
@joshcanhelp joshcanhelp deleted the update-feature-settings-validation branch January 31, 2020 20:10
@joshcanhelp joshcanhelp changed the title Update feature settings validation Update Feature settings validation and defaults Jan 31, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants