You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trigger_deprecation('twig/twig', '3.28', 'Passing a "Twig\Source" as the 4th argument of "%s()" is deprecated; pass an array of tests instead.', __METHOD__);
74
-
$source = $tests;
75
-
$tests = [];
76
-
}
77
-
78
-
if (!$this->isSandboxed($source)) {
79
-
return;
80
-
}
81
-
82
-
if ((new \ReflectionMethod($this->policy, 'checkSecurity'))->getNumberOfParameters() >= 4) {
trigger_deprecation('twig/twig', '3.28', 'The "%s::checkSecurity()" method will take a 4th "array $tests" argument in 4.0; not declaring it is deprecated.', $this->policy::class);
trigger_deprecation('twig/twig', '3.28', 'Not passing the "$usedTests" argument to "%s::__construct()" is deprecated; it will be required in 4.0.', static::class);
Copy file name to clipboardExpand all lines: src/NodeVisitor/CorrectnessNodeVisitor.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ private function checkConfigTag(ConfigNode $node): void
159
159
}
160
160
161
161
if (!isset($this->rootNodes[$node])) {
162
-
trigger_deprecation('twig/twig', '3.27', 'Using the "%s" tag outside the root of a template is deprecated in %s at line %d.', $node->getNodeTag(), $node->getSourceContext()->getName(), $node->getTemplateLine());
162
+
thrownewSyntaxError(\sprintf('The "%s" tag can only be used at the root of a template.', $node->getNodeTag()), $node->getTemplateLine(), $node->getSourceContext());
trigger_deprecation('twig/twig', '3.28', 'Not passing the "$tests" argument to "%s::checkSecurity()" is deprecated; it will be required in 4.0.', static::class);
107
-
}
108
-
109
104
foreach ($tagsas$tag) {
110
105
if (!\in_array($tag, $this->allowedTags, true)) {
111
106
thrownewSecurityNotAllowedTagError(\sprintf('Tag "%s" is not allowed.', $tag), $tag);
@@ -126,11 +121,7 @@ public function checkSecurity($tags, $filters, $functions, array $tests = []): v
126
121
127
122
foreach ($testsas$test) {
128
123
if (!\in_array($test, $this->allowedTests, true)) {
129
-
if (!$this->strict) {
130
-
trigger_deprecation('twig/twig', '3.28', 'The "%s" test is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitly in your sandbox policy if needed (or enable strict mode on the security policy to opt-in to the 4.0 behavior now).', $test);
131
-
} else {
132
-
thrownewSecurityNotAllowedTestError(\sprintf('Test "%s" is not allowed.', $test), $test);
133
-
}
124
+
thrownewSecurityNotAllowedTestError(\sprintf('Test "%s" is not allowed.', $test), $test);
0 commit comments