Load config-spec.php in a "filterable" way#5664
Conversation
schlessera
left a comment
There was a problem hiding this comment.
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>
schlessera
left a comment
There was a problem hiding this comment.
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.phploading to a standalone method.WP_CLI_CONFIG_SPEC_FILTER_CALLBACKagainst$config_specif callback is defined.WP_CLI_EARLY_REQUIREenvironment variable for early loading of a PHP file.Fixes #5649