-
Notifications
You must be signed in to change notification settings - Fork 999
Load config-spec.php
in a "filterable" way
#5664
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
Conversation
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.
Here's my suggestion. Adding a definable INCLUDE seems overly permissive. A simple filter callback will be enough, and it cannot be completely abused.
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
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.
This latest approach looks fine to me. I'm not super happy about a general require
, but I understand its value and I cannot think of an immediate attack vector right now that wouldn't be doable in some other already existing entrypoint anyways.
Now, how about adding tests for this?
@schlessera Added with 4073a34 |
🎉 Thanks for your help with this, @schlessera ! Appreciate it 😊 |
@danielbachhuber I now noticed that the test seems to be in the wrong file. It is in the |
@schlessera Sorry about that! PR to fix with #5687 |
config-spec.php
loading to a standalone method.WP_CLI_CONFIG_SPEC_FILTER_CALLBACK
against$config_spec
if callback is defined.WP_CLI_EARLY_REQUIRE
environment variable for early loading of a PHP file.Fixes #5649