mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-03 17:45:15 +00:00
Fix sandbox __toString bypasses
This commit is contained in:
@@ -28,7 +28,7 @@ use Twig\Source;
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
#[YieldReady]
|
||||
final class ModuleNode extends Node
|
||||
final class ModuleNode extends Node implements CoercesChildrenToStringInterface
|
||||
{
|
||||
/**
|
||||
* @param BodyNode $body
|
||||
@@ -90,6 +90,12 @@ final class ModuleNode extends Node
|
||||
}
|
||||
}
|
||||
|
||||
public function getStringCoercedChildNames(): array
|
||||
{
|
||||
// the parent expression is resolved through the loader, which coerces it to a string
|
||||
return $this->hasNode('parent') ? ['parent'] : [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user