-
Notifications
You must be signed in to change notification settings - Fork 799
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
WAF: Avoid using Waf_Rules_Manager from Waf_Runner::initialize() #38944
base: trunk
Are you sure you want to change the base?
WAF: Avoid using Waf_Rules_Manager from Waf_Runner::initialize() #38944
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? Reach out in #jetpack-developers for guidance! Debug Helper plugin:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
458423c
to
b5b4421
Compare
b5b4421
to
2be0c14
Compare
PHP compatibility warnings appear unrelated to the changes in this PR. |
@@ -223,15 +222,15 @@ public static function generate_rules() { | |||
Waf_Runner::initialize_filesystem(); | |||
|
|||
$rules = "<?php\n"; | |||
$entrypoint_file_path = Waf_Runner::get_waf_file_path( self::RULES_ENTRYPOINT_FILE ); | |||
$entrypoint_file_path = Waf_Runner::get_waf_file_path( Waf_Runner::ENTRYPOINT_FILE ); |
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.
I am wondering if this is problematic - will this generate_rules
method run within a request where an outdated Waf_Runner
class was autoloaded in standalone mode, creating the same issue?
Wondering if we just need to duplicate the deceleration of the entrypoint file value, or provide it from a third source separate from the runner and rule manager classes... or just safely handle it potentially being undefined.
🤔
…NT_FILE to prevent Waf_Rules_Manager from autoloading during standalone mode execution
7cf67fe
to
60ee2a9
Compare
60ee2a9
to
c8ded65
Compare
810dad6
to
e789c15
Compare
Related to https://github.com/Automattic/jpop-issues/issues/9175
Proposed changes:
Waf_Rules_Manager::RULES_ENTRYPOINT_FILE
to a newJETPACK_WAF_ENTRYPOINT
constant, to avoid autoloading theWaf_Rules_Manager
class during standalone mode firewall execution.Other information:
Jetpack product discussion
peb6dq-2HL-p2
Does this pull request change what data or activity we track or use?
No
Testing instructions: