Skip to content

Commit

Permalink
minor #4246 fix typo (xabbuh)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

fix typo

Commits
-------

8663ec2 fix typo
  • Loading branch information
fabpot committed Aug 28, 2024
2 parents d379eef + 8663ec2 commit bd48875
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ determine how to convert the code to PHP:
{# it is converted to the following PHP code: (6 & 2) || (6 & 16) #}
Change the default precedence by explicitely grouping expressions with parentheses:
Change the default precedence by explicitly grouping expressions with parentheses:

.. code-block:: twig
Expand Down
4 changes: 2 additions & 2 deletions src/Sandbox/SecurityPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public function checkSecurity($tags, $filters, $functions): void
foreach ($tags as $tag) {
if (!\in_array($tag, $this->allowedTags)) {
if ('extends' === $tag) {
trigger_deprecation('twig/twig', '3.12', 'The "extends" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitely in your sandbox policy if needed.');
trigger_deprecation('twig/twig', '3.12', 'The "extends" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitly in your sandbox policy if needed.');
} elseif ('use' === $tag) {
trigger_deprecation('twig/twig', '3.12', 'The "use" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitely in your sandbox policy if needed.');
trigger_deprecation('twig/twig', '3.12', 'The "use" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitly in your sandbox policy if needed.');
} else {
throw new SecurityNotAllowedTagError(\sprintf('Tag "%s" is not allowed.', $tag), $tag);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Extension/SandboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getSandboxedForCoreTagsTests()
*/
public function testSandboxForExtendsAndUseTags(string $tag, string $template)
{
$this->expectDeprecation(sprintf('Since twig/twig 3.12: The "%s" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitely in your sandbox policy if needed.', $tag));
$this->expectDeprecation(sprintf('Since twig/twig 3.12: The "%s" tag is always allowed in sandboxes, but won\'t be in 4.0, please enable it explicitly in your sandbox policy if needed.', $tag));

$twig = $this->getEnvironment(true, [], self::$templates, []);
$twig->createTemplate($template, 'index')->render([]);
Expand Down

0 comments on commit bd48875

Please sign in to comment.