Update dependency twig/twig to v3 [SECURITY] - #26
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/packagist-twig-twig-vulnerability
branch
from
May 23, 2026 03:33
415e330 to
389407c
Compare
renovate
Bot
force-pushed
the
renovate/packagist-twig-twig-vulnerability
branch
from
July 2, 2026 04:06
389407c to
e1b4491
Compare
|
Tick the box to add this pull request to the merge queue (same as
|
4 similar comments
|
Tick the box to add this pull request to the merge queue (same as
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
Tick the box to add this pull request to the merge queue (same as
|
|
Tick the box to add this pull request to the merge queue (same as
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^1.0||^2.0→3.27.0Twig Sandbox Information Disclosure
CVE-2019-9942 / GHSA-vxrc-68xx-x48g
More information
Details
A sandbox information disclosure exists in Twig before 1.38.0 and 2.x before 2.7.0 because, under some circumstances, it is possible to call the
__toString()method on an object even if not allowed by the security policy in place.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig may load a template outside a configured directory when using the filesystem loader
CVE-2022-39261 / GHSA-52m2-vc4m-jj33
More information
Details
Description
When using the filesystem loader to load templates for which the name is a user input, it is possible to use the
sourceorincludestatement to read arbitrary files from outside the templates directory when using a namespace like@somewhere/../some.file(in such a case, validation is bypassed).Resolution
We fixed validation for such template names.
Even if the 1.x branch is not maintained anymore, a new version has been released.
Credits
We would like to thank Dariusz Tytko for reporting the issue and Fabien Potencier for fixing the issue.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig has a possible sandbox bypass
CVE-2024-45411 / GHSA-6j75-5wfj-gh66
More information
Details
Description
Under some circumstances, the sandbox security checks are not run which allows user-contributed templates to bypass the sandbox restrictions.
The security issue happens when all these conditions are met:
include()function which references a template name (likeincluded.twig) and not aTemplateorTemplateWrapperinstance;include()call but in a non-sandbox context (possible as the sandbox has been globally disabled).Resolution
The patch ensures that the sandbox security checks are always run at runtime.
Credits
We would like to thank Fabien Potencier for reporting and fixing the issue.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig has unguarded calls to
__toString()when nesting an object into an arrayCVE-2024-51754 / GHSA-6377-hfv9-hqf6
More information
Details
Description
In a sandbox, an attacker can call
__toString()on an object even if the__toString()method is not allowed by the security policy when the object is part of an array or an argument list (arguments to a function or a filter for instance).Resolution
The sandbox mode now checks the
__toString()method call on all objects.The patch for this issue is available here for the 3.11.x branch, and here for the 3.x branch.
Credits
We would like to thank Jamie Schouten for reporting the issue and Fabien Potencier for providing the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig has unguarded calls to
__isset()and to array-accesses when the sandbox is enabledCVE-2024-51755 / GHSA-jjxq-ff2g-95vh
More information
Details
Description
In a sandbox, and attacker can access attributes of Array-like objects as they were not checked by the security policy.
They are now checked via the property policy and the
__isset()method is now called after the security check.This is a BC break.
Resolution
The sandbox mode now ensures access to array-like's properties is allowed.
The patch for this issue is available here for the 3.11.x branch, and here for the 3.x branch.
Credits
We would like to thank Jamie Schouten for reporting the issue and Nicolas Grekas for providing the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: The
spacelessfilter implicitly marks its output as safeCVE-2026-46628 / GHSA-4j38-f5cw-54h7
More information
Details
Description
The
spacelessfilter is registered withis_safe => ['html'], which means Twig's autoescaper does not escape its output in an HTML context. As a result, applyingspacelessto attacker-controlled input that contains markup emits the markup unescaped even when the developer never wrote|rawand autoescape is enabled.Example:
{% set payload = '<script>alert()</script>' %} {{ payload }} {# escaped #} {{ payload|spaceless }} {# not escaped #}The filter is deprecated but still functional. With the deprecation, some downstream projects (e.g. Drupal modules) have duplicated the filter and inherited the same
is_safeflag.Resolution
The
spacelessfilter no longer marks its output as safe. Documentation has been updated to warn thatspacelessshould not be applied to unsanitised user input.Credits
Twig would like to thank Pierre Rudloff for reporting the issue.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:UReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: PHP code injection via
{% use %}template nameCVE-2026-46633 / GHSA-7p85-w9px-jpjp
More information
Details
Description
Compiler::string()escapes",$,\, NUL and TAB when generating PHP double-quoted string literals, but does not escape single quotes. InModuleNode::compileConstructor(), the template name from a{% use %}tag is compiled viasubcompile()->string()and placed inside a surrounding PHP single-quoted string literal. A template name containing a single quote terminates that surrounding string early, allowing arbitrary PHP expressions to be injected into the compiled cache file.The injected code executes within the PHP process when the cache file is first loaded, bypassing the Twig sandbox entirely and achieving remote code execution.
SecurityPolicyunconditionally allows{% use %}regardless of the configuredallowedTags, so this primitive is reachable from sandboxed templates as well.Resolution
Compiler::string()now also escapes single quotes so that template names placed inside single-quoted PHP literals can no longer break out of the surrounding context.Credits
Twig would like to thank Anvil Secure in collaboration with Claude and Anthropic Research for reporting the issue and providing the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox property allowlist bypass via the
columnfilter (array_column on objects)CVE-2026-46635 / GHSA-vcc8-phrv-43wj
More information
Details
Description
The
columnfilter passes its input straight to PHP's nativearray_column(). When the array elements are objects,array_column()reads$obj->$name(and$obj->$index) directly, including invoking__get/__isset. Because this property read happens entirely in PHP native code and never reachesCoreExtension::getAttribute(),SandboxExtension::checkPropertyAllowed()is never consulted.An untrusted template author with
columnin theirallowedFilterslist can therefore read any public or magic property of any object reachable in the render context, regardless of theSecurityPolicyallowedPropertieslist. This is a variant of CVE-2024-51755 / GHSA-jjxq-ff2g-95vh that theArrayAccess-focused fix did not cover.Resolution
The
columnfilter now routes object property reads through the sandbox-aware attribute accessor so the property allowlist is enforced.Credits
Twig: would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig:
{% sandbox %}{% include %}skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411)CVE-2026-46638 / GHSA-7fxw-r6jv-74c8
More information
Details
Description
The fix for CVE-2024-45411 / GHSA-6j75-5wfj-gh66 added an explicit
$loaded->unwrap()->checkSecurity()call inCoreExtension::include()so that a template already cached inEnvironment::$loadedTemplatesis re-checked when included withsandboxed = true.The deprecated but still functional
{% sandbox %}{% include ... %}{% endsandbox %}tag path was not updated: it compiles toenableSandbox(); yield from $this->load(...)->unwrap()->yield(...); disableSandbox();with nocheckSecurity()re-invocation. If the included template was loaded once outside the sandbox in the sameEnvironmentinstance, its constructor (and therefore its compiledcheckSecurity()call) already ran whileisSandboxed()wasfalse, so the tags/filters/functions allowlist enforced bySecurityPolicy::checkSecurity()is never applied.An attacker who can author the included template gains access to every filter, function and tag registered in the environment, regardless of the sandbox policy.
Resolution
The compiled output of
{% sandbox %}{% include %}now callscheckSecurity()on the loaded template, matching the behaviour ofCoreExtension::include()withsandboxed = true.Credits
Twig would like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix.
Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox: multiple
__toString()policy bypasses via unguarded string coercion pointsCVE-2026-47732 / GHSA-pr2w-4gpj-cpq4
More information
Details
Description
SandboxNodeVisitorenforcesSecurityPolicy::checkMethodAllowed()for implicit__toString()calls by wrapping selected AST nodes inCheckToStringNode. The set of wrapped nodes is incomplete, and several Twig language constructs still trigger PHP string coercion on aStringableoperand without first consulting the policy. A sandboxed template author can therefore invoke__toString()on any object reachable in the render context, even when__toStringon its class is not allowlisted.Confirmed bypass vectors:
a ? b : c,a ?: b,a ?? b) used as the input of a string-coercing filter or as a filter/function argument.matchesoperator and the loose comparison operators (==,!=,<,>,<=,>=,<=>), which coerce aStringableoperand to string and can be used as an oracle to recover the value byte by byte (no tag, filter or function needs to be allowlisted).is emptywhich casts aStringablevalue via(string) $valueinCoreExtension::testEmpty().Stringableobject.include,extends,use, ...), dynamic attribute/property names, and spread arguments fromTraversableobjects.dotag and the..range operator.Resolution
The sandbox now wraps every child node that the parent will string-coerce at runtime, instead of relying on a hardcoded list of node types in
SandboxNodeVisitor. A newTwig\Node\CoercesChildrenToStringInterfacelets nodes declare which of their children must be guarded; core nodes (concatenation, comparison and range binaries, filter/function/test expressions,do,include,extends,use, ...) implement it. Spread arguments are materialised and policy-checked via the newSandboxExtension::ensureSpreadAllowed(), and dynamic attribute names are checked at runtime insideCoreExtension::getAttribute().Credits
Twig would like to thank Anthropic Glasswing and El Kharoubi Iosif for reporting the issues, and Fabien Potencier for providing the fixes.
Severity
High
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox
__toString()policy bypass via dynamic mapping keysCVE-2026-48806 / GHSA-5v5v-ww74-355v
More information
Details
Description
This is a residual bypass of CVE-2026-47732 / GHSA-pr2w-4gpj-cpq4 left after the initial fix for unguarded
__toString()calls.In 3.26.0 the sandbox visitor was extended to wrap every child node that its parent will string-coerce at runtime with
CheckToStringNode, gated by the newCoercesChildrenToStringInterface.ArrayExpressiondid not implement the interface for its mapping keys: when a dynamic key expression resolves to aStringableobject,ArrayExpression::compile()emits a raw(string)cast (viaStringCastUnaryforContextVariablekeys, and no cast at all for richer key expressions). PHP then invokes__toString()directly, without ever callingSandboxExtension::ensureToStringAllowed().A sandboxed template author can therefore trigger
__toString()on any object reachable in the render context by using it as a dynamic mapping key, for example:{% set arr = {(obj): "value"} %}Direct output of the same object is correctly blocked, which makes this a clear policy enforcement gap. The reliable demonstrated impact is unauthorised disclosure of data returned by
__toString().Resolution
ArrayExpressionnow declares its dynamic mapping keys as string-coercion sites throughCoercesChildrenToStringInterface, so the sandbox visitor wraps them withCheckToStringNodeand the policy is consulted before PHP coerces the key to a string. The compiler also keeps an explicit(string)cast around the wrapped expression so PHP type errors on non-string keys are preserved.As a side effect, any expression is now accepted as a dynamic mapping key (not only context variables); this is documented as a new feature on the 3.x branch.
Credits
Twig would like to thank El Kharoubi Iosif for reporting the issue and Fabien Potencier for providing the fix.
Severity
Medium
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox
__toString()policy bypass viaTraversableinjoinandreplacefiltersCVE-2026-48807 / GHSA-8x9c-rmqh-456c
More information
Details
Description
This is a residual bypass of CVE-2026-47732 / GHSA-pr2w-4gpj-cpq4 left after the initial fix for unguarded
__toString()calls. It covers two related coercion points that were not caught by the original patch.Traversableinjoinandreplacefilters.SandboxExtension::ensureToStringAllowed()recurses into PHP arrays so that aStringableobject hidden inside an array argument cannot be string-coerced without consulting the security policy. The recursion stops at PHP arrays: aTraversablevalue passed at the same position is not materialised, so its contents are not policy-checked.CoreExtension::join()andCoreExtension::replace()later materialise suchTraversableinputs throughself::toArray()and feed them toimplode()/strtr(), both of which implicitly call__toString()on containedStringableobjects. The bypass also reproduces when the container implements bothStringableandTraversable: the container's own__toString()is policy-checked, but the elements yielded bygetIterator()are not, and the consuming filters still coerce them to string.inandnot inoperators.InBinaryandNotInBinarycompile toCoreExtension::inFilter(), which falls through to PHP's<=>operator when comparing a string with aStringableobject. PHP coerces the object to string via__toString()without the sandbox policy being consulted. Beyond the direct side effect,incan also be used as a content-leak oracle: each probe against an attacker-chosen needle leaks one bit of equality, and chained probes can reconstruct the string returned by__toString()even when every method is denied. The bypass reproduces with both array andTraversablehaystacks, and on both operand sides.A sandboxed template author who is allowed to call
join/replace, or to use thein/not inoperators, can therefore trigger a disallowed__toString()method on objects reachable from the render context, even when that method is not onSecurityPolicy::$allowedMethods. The bypass reproduces both under global sandbox mode and when sandboxing is enabled throughSourcePolicyInterface.Resolution
SandboxExtension::ensureToStringAllowed()now also recurses intoTraversableoperands when sandboxing is active for the current source: each value is materialised once and run through the same array-recursion path, so the policy is consulted before the filter implementation can coerce contained objects to strings. This applies to plainTraversableoperands as well as to containers that implement bothStringableandTraversable: the container's own__toString()is still policy-checked, and the yielded elements are additionally checked. The materialisation is guarded byisSandboxed($source)so that non-sandboxed code paths do not pay the cost or change generator-exhaustion semantics.InBinaryandNotInBinarynow implementTwig\Node\CoercesChildrenToStringInterfaceand declare both operands as string-coerced, soSandboxNodeVisitorwraps each operand inCheckToStringNode. The policy is consulted beforeCoreExtension::inFilter()reaches PHP's<=>operator, matching the existing protection on the other comparison binaries (Equal,Less,Greater,Spaceship, ...).Credits
Twig would like to thank Vincent55 Yang and Fabien Potencier for reporting the issues and Fabien Potencier for providing the fix.
Severity
Medium
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox property allowlist bypass via the
columnfilter underSourcePolicyInterfaceCVE-2026-48808 / GHSA-h8vq-8gpg-mhcg
More information
Details
Description
This is a residual bypass of CVE-2026-46635 / GHSA-vcc8-phrv-43wj that only affects sandboxing enabled through
SourcePolicyInterface(and not the regular global sandbox mode).CoreExtension::column()receives the active sandbox state via theneeds_is_sandboxedchannel as a boolean$isSandboxed, but then routes the per-element property reads throughSandboxExtension::checkPropertyAllowed()without forwarding the currentSource.SandboxExtension::checkPropertyAllowed()re-evaluatesisSandboxed($source)internally; with$source = nulltheSourcePolicyInterface-driven decision is lost, the method short-circuits to "not sandboxed", and the property allowlist is never consulted.A template author whose sandbox is gated by a
SourcePolicyInterfaceand who hascolumnon theirallowedFilterslist can therefore read any public or magic property of any object reachable in the render context, regardless ofSecurityPolicy::$allowedProperties. Direct attribute access to the same property is blocked, and the same payload is also blocked under global sandbox mode, which makes this a clear policy enforcement gap rather than a configuration issue.Resolution
CoreExtension::column()no longer goes through theSandboxExtensionwrapper for the property check. It calls the security policy directly: the per-source decision is already captured by the$isSandboxedboolean computed at the call site, so the property allowlist is enforced consistently for both global and source-policy sandboxing.Credits
Twig would like to thank Vincent55 Yang for reporting the issue and Fabien Potencier for providing the fix.
Severity
Medium
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox state regression in deprecated internal wrappers in
src/Resources/core.phpCVE-2026-48805 / GHSA-p42q-9prx-q5wq
More information
Details
Description
The 3.26.0 source-policy hardening changed the signature of
CoreExtension::checkArrow()to take a boolean$isSandboxedinstead of anEnvironment, and added the same$isSandboxedargument toCoreExtension::arraySome()andCoreExtension::arrayEvery(). Compiled templates were updated to pass the per-source sandbox state computed at the call site.The deprecated internal wrappers exposed in
src/Resources/core.phpfor legacy third-party code (twig_check_arrow_in_sandbox(),twig_array_some(),twig_array_every()) were not updated:twig_array_some()andtwig_array_every()callCoreExtension::arraySome()/arrayEvery()without forwarding the sandbox state. The underlying methods default$isSandboxedtofalse, so the callable-must-be-a-Closurerestriction is silently bypassed in sandbox mode and a string callable such as'strcmp'is accepted.twig_check_arrow_in_sandbox()passes theEnvironmentobject whereCoreExtension::checkArrow()now expects abool, which throws aTypeErroron PHP 8+.Compiled Twig templates are not affected: they call
CoreExtension::*directly with the correct arguments. Applications are only impacted if they still call the deprecatedtwig_*helpers on top of a sandboxedEnvironment.Resolution
The three wrappers now resolve the current sandbox state via
twig_resolve_is_sandboxed()(the same helper compiled templates use), and forward it to the correspondingCoreExtension::*method.twig_check_arrow_in_sandbox()no longer triggers aTypeError, andtwig_array_some()/twig_array_every()now enforce the same sandbox restriction as compiled templates.Credits
We would like to thank El Kharoubi Iosif for reporting the issue and Fabien Potencier for providing the fix.
Severity
Low
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Twig: Sandbox filter, tag and function allow-list bypass when sandbox state changes between renders for a cached
TemplateCVE-2026-49981 / GHSA-529h-vh3j-85hq
More information
Details
Description
The per-template filter, tag and function allow-list check is compiled into the
checkSecurity()method of eachTemplatesubclass and was invoked once from the constructor, gated bySandboxExtension::isSandboxed($source).Templateinstances are then cached on theEnvironmentin$loadedTemplates, so the verdict computed at construction time was sticky for the rest of the process.Any later change of sandbox state on the same
Environmentleft that cached verdict in place: togglingSandboxExtension::enableSandbox()/disableSandbox(), swapping the policy viasetSecurityPolicy(), aSourcePolicyInterfacedecision flip, or simply having a parent, macro or included template pre-instantiated outside the sandbox before a sandboxed render reached it. In all of these cases, the filters, tags and functions used by the affected template kept running with the original (typically empty) check, bypassing theSecurityPolicyallow-list.Method, property and
__toStringallow-lists are not affected: they are enforced at every call site at runtime throughSandboxExtension::checkMethodAllowed(),checkPropertyAllowed()andensureToStringAllowed(), which re-read the current state on every call.Long-lived workers (FrankenPHP, RoadRunner, Symfony Messenger consumers, FPM with hot autoloading) that share a single
Environmentbetween sandboxed and non-sandboxed renders are the most exposed: a single non-sandboxed render of a shared layout pre-warms itsTemplateinstance, after which any later sandboxed render that extends, uses, includes or imports from that layout silently skips the filter/tag/function allow-list for the pre-warmed instance.Resolution
The allow-list check is no longer run from the constructor.
Templategains a publicensureSecurityChecked()method that calls the compiledcheckSecurity()only whenSandboxExtension::isSandboxed($source)returns true for the current source, and it is invoked at every entry point that can reach aTemplateinstance whose security has not yet been verified against the current state:Template::yield(),Template::yieldBlock()(on the resolved block template, which coversextends,use, traits and parent blocks),Template::getParent()(which evaluates user code when the parent name is dynamic) andTemplate::getTemplateForMacro()(on the resolved macro template).The explicit
checkSecurity()calls previously emitted byIncludeNodeandCoreExtension::include()are removed: the included template's ownyield()now re-runs the check against the current sandbox state. The compiledcheckSecurity()body is a cheap walk over compile-time-static arrays, so the per-render cost is negligible. Old cached compiled PHP files keep working unchanged: the constructor-time call they still contain is idempotent.Credits
Twig would like to thank Fabien Potencier for reporting and fixing the issue.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
twigphp/Twig (twig/twig)
v3.27.0Compare Source
Twig\Sandbox\SecurityPolicyto opt-in to the 4.0 behavior for theextends/usetags and theparent/block/attributefunctions, which are otherwise still implicitly allowed in a sandboxparent,block, andattributefunctions are always allowed in a sandboxed templateTemplateinstanceArrayAccessattribute access with a float keyTwig\Profiler\Profile::unserialize()to prevent arbitrary class instantiationHtmlDumpertwig_array_some(),twig_array_every(), andtwig_check_arrow_in_sandbox()(src/Resources/core.php)Twig\Sandbox\SourcePolicyInterfaceinterface with no replacementSourcePolicyInterface__toStringbypass viaTraversablearguments to thejoinandreplacefilters (also covers containers that implement bothStringableandTraversable)__toStringbypass via theinandnot inoperatorsSandboxExtension::ensureToStringAllowed()when a self-referencing iterable is passed to a sandboxed template__toStringpolicy bypass via dynamic mapping keysv3.26.0Compare Source
template_from_stringcaveats when used in a sandboxed environmentMarkupabout the goal of this class in the context of a sandboxspacelessfilterinline_cssandinky_to_htmlfiltersis_safeannotation on HTML-emitting filtersHtmlDumperIntlDateFormatter/NumberFormatter{% sandbox %}tag when including a preloaded template{% use %}template name_self/ import macro referenceSourcetocheckArrowfor source-policy sandboxing\x27inCompiler::string()as a defense-in-depth measure__toStringbypassesTwig\Node\CoercesChildrenToStringInterfaceto let nodes declare which of their child nodes will be string-coerced at runtime so the sandbox wraps them with a__toStringcheckv3.25.0Compare Source
needs_is_sandboxedoption for filters, functions, and testsEscaperRuntimeinEscaperExtensionv3.24.0Compare Source
getOperatorTokens()method inExpressionParserInterfaceimplementationsAbstractExpressionnode toTwig\Node\Expression\Binary\MatchesBinaryconstructorAbstractExpressionnode toParser::setParent(){name: userName} = user)html_attr_relaxedescaping strategy that preserves :, @, [, and ] for front-end framework attribute nameshtml_attrfunction andhtml_attr_mergeas well ashtml_attr_typefiltersv3.23.0Compare Source
=assignment operator (allows to set variables in expression or to replace the short-form of the set tag)?.null-safe operator===and!==operators (equivalent to thesame asandnot same astests)v3.22.2Compare Source
v3.22.1Compare Source
v3.22.0Compare Source
Environment::registerUndefinedTestCallback()v3.21.1Compare Source
v3.21.0Compare Source
Template::loadTemplate()MarkupReturnPrimitiveTypeInterface(and sub-interfaces for number, boolean, string, and array)SupportDefinedTestInterfacefor expression nodes supporting thedefinedtest|operator in an expression with+or-without using parentheses to clarify precedenceinstead of arrays (it comes with many deprecations that are documented in
the
deprecateddocumentation chapter)Twig\ExpressionParser, andTwig\OperatorPrecedenceChangeclassesAsTwigFilter,AsTwigFunction, andAsTwigTestto ease extension developmentv3.20.0Compare Source
ForElseNodev3.19.0Compare Source
??Token::getType(), useToken::test()insteadToken::toEnglish()ForElseNodeTwig\ExpressionParser::parseOnlyArguments()andTwig\ExpressionParser::parseArguments()(useTwig\ExpressionParser::parseNamedArguments()instead)constant()behavior when used with??invokefilter{}optional for thetypestagLastModifiedExtensionInterfaceand implementation inAbstractExtensionto track modification of runtime classesv3.18.0Compare Source
SyntaxErrorexceptions from undefined handlers when using theguardtagTemplateWrapper::stream()andTemplateWrapper::streamBlock())v3.17.1Compare Source
v3.17.0Compare Source
ConditionalExpressionandNullCoalesceExpression(useConditionalTernaryandNullCoalesceBinaryinstead)v3.16.0Compare Source
InlinePrintSourceinstance toTokenStreamnullfromTwigFilter::getSafe()andTwigFunction::getSafe(), return[]insteadv3.15.0Compare Source
this can be a BC break if you don't use UPPERCASE constant names
pluralandsingularfilters in the String extensionTempNameExpressionin favor ofLocalVariableNameExpressionin favor ofContextVariableAssignNameExpressionin favor ofAssignContextVariableMacroAutoImportNodeVisitorMethodCallExpressionin favor ofMacroReferenceExpression_self.xxx(auto-imported) macrosConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.