nystudio107/craft-twig-sandbox
Allows you to easily create a sandboxed Twig environment where you can control what tags, filters, functions, and object methods/properties are allowed
5.0.5
596K downloads/mo
#3627 most downloaded on Packagist
nystudio107/craft-twig-sandbox
What this package is like to depend on
Last release 1 years ago
18 Aug 2025
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 13 of 16 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
16 releases · first in 2024
0 releases in the last 12 months
see the full history below
Release timeline
16 releases · Jul 2024 to Aug 2025Releases
latest 16-
5.0.518 Aug 2025Release notes
Open source →Added
- Provide a mechanism for adding Twig Extensions in bulk to the
SandboxView(#1632)
Release notes
Open source →Added
- Provide a mechanism for adding Twig Extensions in bulk to the
SandboxView(#1632)
- Provide a mechanism for adding Twig Extensions in bulk to the
-
5.0.410 Jun 2025Release notes
Open source →Fixed
- Remove errant dependency on SEOmatic in the
SecurityPolicyhelper class
Release notes
Open source →Fixed
- Remove errant dependency on SEOmatic in the
SecurityPolicyhelper class
- Remove errant dependency on SEOmatic in the
-
5.0.308 Jun 2025Release notes
Open source →Added
- Add an example
config/blacklist-sandbox.phpandconfig/whitelist-sandbox.phpfiles for user-customizable Twig sandbox environments - Add
SecurityPolicy::createFromFile()to create a new Twig sandbox from a config file in theconfig/directory
Changed
- Cleaned up the
BlacklistSecurityPolicyto no longer blacklist innocuous tags/filters/functions
Release notes
Open source →Added
- Add an example
config/blacklist-sandbox.phpandconfig/whitelist-sandbox.phpfiles for user-customizable Twig sandbox environments - Add
SecurityPolicy::createFromFile()to create a new Twig sandbox from a config file in theconfig/directory
Changed
- Cleaned up the
BlacklistSecurityPolicyto no longer blacklist innocuous tags/filters/functions
- Add an example
-
5.0.218 Feb 2025Release notes
Open source →Added
- Craft Twig Sandbox no longer automatically handles exceptions when rendering sandbox templates. Instead, you can decide whether to handle the exception yourself, or pass it along to the
sandboxErrorHandlerfor display in the browser/console
Changed
- Use the official
markhuot/craft-pest-core:^2.0.4package instead of the patch version from @bencroker
- Craft Twig Sandbox no longer automatically handles exceptions when rendering sandbox templates. Instead, you can decide whether to handle the exception yourself, or pass it along to the
-
5.0.131 Jul 2024Release notes
Open source →Changed
- Removed the special-casing for the Craft Closure, since it now uses a different loading mechanism
- Simplify the
SanboxViewto use::registerTwigExtensionrather than overriding::createTwig()
-
5.0.003 Jul 2024 -
4.0.518 Aug 2025Release notes
Open source →Added
- Provide a mechanism for adding Twig Extensions in bulk to the
SandboxView(#1632)
- Provide a mechanism for adding Twig Extensions in bulk to the
-
4.0.410 Jun 2025Release notes
Open source →Fixed
- Remove errant dependency on SEOmatic in the
SecurityPolicyhelper class
- Remove errant dependency on SEOmatic in the
-
4.0.308 Jun 2025Release notes
Open source →Added
- Add an example
config/blacklist-sandbox.phpandconfig/whitelist-sandbox.phpfiles for user-customizable Twig sandbox environments - Add
SecurityPolicy::createFromFile()to create a new Twig sandbox from a config file in theconfig/directory
Changed
- Cleaned up the
BlacklistSecurityPolicyto no longer blacklist innocuous tags/filters/functions
- Add an example
-
4.0.218 Feb 2025Nothing published for this version
-
4.0.131 Jul 2024Nothing published for this version
-
4.0.003 Jul 2024Nothing published for this version
-
3.0.618 Aug 2025Release notes
Open source →Added
- Provide a mechanism for adding Twig Extensions in bulk to the
SandboxView(#1632)
- Provide a mechanism for adding Twig Extensions in bulk to the
-
3.0.511 Jun 2025Release notes
Open source →Fixed
- Fixed an issue with PHP versions less than
7.4and theSandboxViewclass (#1614)
- Fixed an issue with PHP versions less than
-
3.0.410 Jun 2025Release notes
Open source →Fixed
- Remove errant dependency on SEOmatic in the
SecurityPolicyhelper class
- Remove errant dependency on SEOmatic in the
-
3.0.309 Jun 2025