From 4ea8838d3be73518e043ceb121c105f1000c30c5 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 20 Jan 2023 23:42:08 +0100 Subject: [PATCH] Fix testRegisterCompilerFunction by parsing argument correctly. --- src/Compile/Tag/BCPluginWrapper.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Compile/Tag/BCPluginWrapper.php b/src/Compile/Tag/BCPluginWrapper.php index 6e0ce1fa..0224250d 100644 --- a/src/Compile/Tag/BCPluginWrapper.php +++ b/src/Compile/Tag/BCPluginWrapper.php @@ -6,6 +6,14 @@ use Smarty\Compile\Base; class BCPluginWrapper extends Base { + /** + * Attribute definition: Overwrites base class. + * + * @var array + * @see Smarty_Internal_CompileBase + */ + public $optional_attributes = array('_any'); + private $callback; public function __construct($callback, bool $cacheable = true) { @@ -17,6 +25,6 @@ class BCPluginWrapper extends Base { * @inheritDoc */ public function compile($args, \Smarty\Compiler\Template $compiler, $parameter = [], $tag = null, $function = null) { - return call_user_func($this->callback, $args, $compiler->getSmarty()); + return call_user_func($this->callback, $this->getAttributes($compiler, $args), $compiler->getSmarty()); } } \ No newline at end of file