-
Notifications
You must be signed in to change notification settings - Fork 8
Setup Wizard: Steps: Use Named Identifiers #1004
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
base: main
Are you sure you want to change the base?
Conversation
WordPress Playground🚀 Your PR has been built and is ready for testing in WordPress Playground! |
ciccio-kit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
|
|
||
| // Define the step the user is on in the setup process. | ||
| $this->step = ( filter_has_var( INPUT_GET, 'step' ) ? absint( filter_input( INPUT_GET, 'step', FILTER_SANITIZE_NUMBER_INT ) ) : 1 ); | ||
| $this->step = ( filter_has_var( INPUT_GET, 'step' ) ? filter_input( INPUT_GET, 'step', FILTER_SANITIZE_FULL_SPECIAL_CHARS ) : 'start' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick (non-blocking): this would be pretty much impossible to exploit, bust since this value is used directly in a include_once at L381 of this same file, what do you think about adding another check here to fallback to 'start' if step is not one of the predefined string values we expect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely agree. Thanks for spotting this - have updated to check the step is registered.
Summary
Refactors the Setup Wizard steps to use named identifiers instead of numeric indices - for example,
start,configurationandfinish. Future PR's will rely on this when optionally adding steps - for example, if third party form plugins are detected, the onboarding Setup Wizard might add an additional step for the user to automatically replace third party forms with Kit forms.Testing
Existing tests pass.
Checklist