From 27dd3e4c577b8d4cef9710eac6d4d03e739cb005 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Thu, 19 Jan 2023 22:35:03 +0100 Subject: [PATCH] Fix function caching function name --- src/Compile/Tag/FunctionClose.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Compile/Tag/FunctionClose.php b/src/Compile/Tag/FunctionClose.php index 353c5cca..b7dda8b1 100644 --- a/src/Compile/Tag/FunctionClose.php +++ b/src/Compile/Tag/FunctionClose.php @@ -57,8 +57,10 @@ class FunctionClose extends Base { $_functionCode = $compiler->getParser()->current_buffer; // setup buffer for template function code $compiler->getParser()->current_buffer = new \Smarty\ParseTree\Template(); + $_funcName = "smarty_template_function_{$_name}_{$compiler->getTemplate()->getCompiled()->nocache_hash}"; - $_funcNameCaching = $_funcName . 'Smarty\Compile\Tag\Nocache'; + $_funcNameCaching = $_funcName . '_nocache'; + if ($compiler->getTemplate()->getCompiled()->getNocacheCode()) { $parentCompiler->tpl_function[$_name]['call_name_caching'] = $_funcNameCaching; $output = "