From 8c93e0765a2636167461e371f4f74a786008d8af Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Fri, 1 Jan 2010 12:07:36 +0000 Subject: [PATCH] - bugfix for obtaining plugins which must be included (related to change of 12/30/2009) --- change_log.txt | 3 +++ .../smarty_internal_templatecompilerbase.php | 14 ++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/change_log.txt b/change_log.txt index 3d4803ac..9b82a002 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +01/01/2009 +- bugfix for obtaining plugins which must be included (related to change of 12/30/2009) + 12/31/2009 - optimization of generated code for doublequoted strings containing variables - rewrite of {function} tag handling diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 45d06551..0ee76966 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -180,8 +180,7 @@ class Smarty_Internal_TemplateCompilerBase { throw new Exception("Plugin \"{$tag}\" not callable"); } } else { - $function = 'smarty_' . $plugin_type . '_' . $tag; - if (is_callable($function) || $function = $this->getPlugin($tag, $plugin_type)) { + if ($function = $this->getPlugin($tag, $plugin_type)) { return $this->callTagCompiler('private_' . $plugin_type . '_plugin', $args, $tag, $function); } } @@ -204,8 +203,7 @@ class Smarty_Internal_TemplateCompilerBase { return $this->callTagCompiler('private_registered_block', $args, $tag); } // block plugin? - $function = 'smarty_block_' . $base_tag; - if (is_callable($function) || $function = $this->getPlugin($base_tag, 'block')) { + if ($function = $this->getPlugin($base_tag, 'block')) { return $this->callTagCompiler('private_block_plugin', $args, $tag, $function); } if ($this->smarty->loadPlugin('smarty_compiler_' . $tag)) { @@ -307,10 +305,10 @@ class Smarty_Internal_TemplateCompilerBase { } return $plugin; - /* } else { - throw new Exception("Plugin {$type} \"{$plugin_name}\" not callable"); - } - */ + } + if (is_callable($plugin)) { + // plugin function is defined in the script + return $plugin; } return false; }