From 83f6154eaeb9b2f4c5b2cc2cc357962432e9bc98 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Mon, 29 Jun 2015 20:45:21 +0200 Subject: [PATCH] - compiler optimization --- libs/sysplugins/smarty_internal_templatecompilerbase.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 28bcf3f8..222b2b23 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -391,6 +391,7 @@ abstract class Smarty_Internal_TemplateCompilerBase $this->smarty->_current_file = $this->template->source->filepath; // free memory unset($this->parser->root_buffer, $this->parser->current_buffer, $this->parser, $this->lex); + self::$_tag_objects = array(); // return compiled code to template object $merged_code = ''; if (!empty($this->mergedSubTemplatesCode)) { @@ -741,15 +742,16 @@ abstract class Smarty_Internal_TemplateCompilerBase // re-use object if already exists if (!isset(self::$_tag_objects[$tag])) { // lazy load internal compiler plugin - $class_name = 'Smarty_Internal_Compile_' . $tag; - if ((class_exists($class_name) || $this->smarty->loadPlugin($class_name)) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) { + $class_name = 'Smarty_Internal_Compile_' . ucfirst($tag); + if (class_exists($class_name) && (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this))) { self::$_tag_objects[$tag] = new $class_name; } else { + self::$_tag_objects[$tag] = false; return false; } } // compile this tag - return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3); + return self::$_tag_objects[$tag] === false ? false : self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3); } /**