From 0eed9b76af1501346911be46fe231af7c8430072 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Tue, 27 Oct 2026 18:18:36 +0000 Subject: [PATCH] - Fixed a bug related to encoding into a template exception --- src/ControlStructure/BlockToken.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ControlStructure/BlockToken.php b/src/ControlStructure/BlockToken.php index 05c828d..773f3d9 100644 --- a/src/ControlStructure/BlockToken.php +++ b/src/ControlStructure/BlockToken.php @@ -31,6 +31,8 @@ class BlockToken implements ControlStructure { return "render(\$___class__template); unset(\$___block); ?>"; case "arguments": + $cleanArguments = htmlspecialchars($arguments); + return << (\$type = gettype(\$e)) === 'object' ? \$e::class : \$type; throw new \Exception( - sprintf('A block awaiting arguments (%s) instead received (%s) with values (%s)', '$arguments', implode(', ', array_map(\$showArgs, \$inlineVariables ?? [])), json_encode(\$inlineVariables)) + sprintf('A block awaiting arguments (%s) instead received (%s) with values (%s)', '$cleanArguments', implode(', ', array_map(\$showArgs, \$inlineVariables ?? [])), json_encode(\$inlineVariables)) ); } /*%EXCEPTION_LINE_BASE%*/?>