Review the proposed patch then download it to apply it manually or execute the following command from the repository root directory:
curl https://fabbot.io/patch/twigphp/Twig/4629/9bdb173ef40ca26a7f97f58cb717f6ac80b1f4be/exception_messages.diff | patch -p0
diff -ru src/Extension/CoreExtension.php src/Extension/CoreExtension.php
--- src/Extension/CoreExtension.php 2025-04-24 11:22:29.736583629 +0000
+++ src/Extension/CoreExtension.php 2025-04-24 11:22:30.685585595 +0000
@@ -2089,7 +2089,7 @@
}
if ($env->hasExtension(SandboxExtension::class) && $env->getExtension(SandboxExtension::class)->isSandboxed()) {
- throw new RuntimeError(\sprintf('The callable passed to the "%s" %s must be a Closure in sandbox mode.', $thing, $type));
+ throw new RuntimeError(\sprintf('The callable passed to the "%s" "%s" must be a Closure in sandbox mode.', $thing, $type));
}
trigger_deprecation('twig/twig', '3.15', 'Passing a callable that is not a PHP \Closure as an argument to the "%s" %s is deprecated.', $thing, $type);