summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2025-04-10 23:47:44 +0200
committerGitHub <noreply@github.com>2025-04-10 23:47:44 +0200
commita5bbba3f05b37b2c98c3d58fa151aa225131d8b7 (patch)
treecdcb440ffe319d2bbb2f3f4bdd4ff3f2d4028066 /src
parenta0664a4ab2e64848684a0fe5f3ed5e71eb920020 (diff)
downloadsmarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.tar.gz
smarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.tar.bz2
smarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.zip
Fix syntax error occurring when registering a function plugin that ends with the string 'close' (#1124)
Fixes #1122
Diffstat (limited to 'src')
-rw-r--r--src/Compiler/Template.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Compiler/Template.php b/src/Compiler/Template.php
index 237407c6..efc52162 100644
--- a/src/Compiler/Template.php
+++ b/src/Compiler/Template.php
@@ -1146,12 +1146,12 @@ class Template extends BaseCompiler {
}
// check if tag is a function
- if ($this->smarty->getFunctionHandler($base_tag)) {
- if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($base_tag, $this)) {
+ if ($this->smarty->getFunctionHandler($tag)) {
+ if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
return (new \Smarty\Compile\PrintExpressionCompiler())->compile(
['nofilter'], // functions are never auto-escaped
$this,
- ['value' => $this->compileFunctionCall($base_tag, $args, $parameter)]
+ ['value' => $this->compileFunctionCall($tag, $args, $parameter)]
);
}
}
@@ -1164,16 +1164,16 @@ class Template extends BaseCompiler {
}
// the default plugin handler is a handler of last resort, it may also handle not specifically registered tags.
- if ($callback = $this->getPluginFromDefaultHandler($base_tag, Smarty::PLUGIN_COMPILER)) {
+ if ($callback = $this->getPluginFromDefaultHandler($tag, Smarty::PLUGIN_COMPILER)) {
if (!empty($parameter['modifierlist'])) {
- throw new CompilerException('No modifiers allowed on ' . $base_tag);
+ throw new CompilerException('No modifiers allowed on ' . $tag);
}
$tagCompiler = new \Smarty\Compile\Tag\BCPluginWrapper($callback);
return $tagCompiler->compile($args, $this, $parameter);
}
if ($this->getPluginFromDefaultHandler($base_tag, Smarty::PLUGIN_FUNCTION)) {
- return $this->defaultHandlerFunctionCallCompiler->compile($args, $this, $parameter, $tag, $base_tag);
+ return $this->defaultHandlerFunctionCallCompiler->compile($args, $this, $parameter, $tag, $tag);
}
if ($this->getPluginFromDefaultHandler($base_tag, Smarty::PLUGIN_BLOCK)) {