Repository navigation
Bugfix: Accept the $tests argument in SecurityPolicy::checkSecurity() - #1591
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Merge Risk:
|
Twig 3.28 deprecates security policies whose checkSecurity() does not declare the 4th "array $tests" argument, and triggers the deprecation on every sandboxed render.
7e4a0a5 to
1092085
Compare
Summary
Twig 3.28 added a 4th
array $testsargument toSecurityPolicyInterface::checkSecurity()in twigphp/Twig#4819. When a policy does not declare it,SandboxExtensiontriggers a deprecation on every sandboxed render, and with deprecation logging enabled that adds a log write to each page load.This adds the argument to
System\Twig\SecurityPolicy::checkSecurity()with a default value, so the method still works with Twig versions before 3.28.Testing
Rendering a sandboxed template with Twig 3.30 raised 1 deprecation before this change and 0 after.