From 4041bd373a252f52820bc045ece7af25a9692207 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Thu, 18 Feb 2021 15:51:00 +0100 Subject: [PATCH] {_translate} & {capture} passes full content-type to FilterInfo --- src/Latte/Macros/CoreMacros.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Latte/Macros/CoreMacros.php b/src/Latte/Macros/CoreMacros.php index 335bcbae5..a3519b9aa 100644 --- a/src/Latte/Macros/CoreMacros.php +++ b/src/Latte/Macros/CoreMacros.php @@ -201,7 +201,7 @@ public function macroTranslate(MacroNode $node, PhpWriter $writer) $value = 'ob_get_clean()'; } - return $writer->write('$_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $_fi, %raw))', $node->context[0], $value); + return $writer->write('$_fi = new LR\FilterInfo(%var); echo %modifyContent($this->filters->filterContent("translate", $_fi, %raw))', implode($node->context), $value); } elseif ($node->empty = ($node->args !== '')) { return $writer->write('echo %modify(($this->filters->translate)(%node.args))'); @@ -257,7 +257,7 @@ public function macroCaptureEnd(MacroNode $node, PhpWriter $writer) $body = in_array($node->context[0], [Engine::CONTENT_HTML, Engine::CONTENT_XHTML], true) ? 'ob_get_length() ? new LR\\Html(ob_get_clean()) : ob_get_clean()' : 'ob_get_clean()'; - return $writer->write("\$_fi = new LR\\FilterInfo(%var); %raw = %modifyContent($body);", $node->context[0], $node->data->variable); + return $writer->write("\$_fi = new LR\\FilterInfo(%var); %raw = %modifyContent($body);", implode($node->context), $node->data->variable); }