Add an always_allowed_in_sandbox flag for filters, functions, and tags

This commit is contained in:
Fabien Potencier
2026-05-25 09:08:30 +02:00
parent e3c0c3fe5a
commit 2d75c87d05
16 changed files with 411 additions and 32 deletions
+6
View File
@@ -34,6 +34,7 @@ abstract class AbstractTwigCallable implements TwigCallableInterface
'needs_charset' => false,
'needs_is_sandboxed' => false,
'is_variadic' => false,
'always_allowed_in_sandbox' => false,
'deprecation_info' => null,
'deprecated' => false,
'deprecating_package' => '',
@@ -113,6 +114,11 @@ abstract class AbstractTwigCallable implements TwigCallableInterface
return $this->options['needs_is_sandboxed'];
}
public function isAlwaysAllowedInSandbox(): bool
{
return $this->options['always_allowed_in_sandbox'];
}
/**
* @return static
*/