mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- minor compiler optimizations
This commit is contained in:
@@ -728,23 +728,18 @@ abstract class Smarty_Internal_TemplateCompilerBase
|
|||||||
*/
|
*/
|
||||||
public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
|
public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null)
|
||||||
{
|
{
|
||||||
// check if tag allowed by security
|
// re-use object if already exists
|
||||||
if (!isset($this->smarty->security_policy) || $this->smarty->security_policy->isTrustedTag($tag, $this)) {
|
if (!isset(self::$_tag_objects[$tag])) {
|
||||||
// re-use object if already exists
|
// lazy load internal compiler plugin
|
||||||
if (!isset(self::$_tag_objects[$tag])) {
|
$class_name = 'Smarty_Internal_Compile_' . $tag;
|
||||||
// lazy load internal compiler plugin
|
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_' . $tag;
|
self::$_tag_objects[$tag] = new $class_name;
|
||||||
if ($this->smarty->loadPlugin($class_name)) {
|
} else {
|
||||||
self::$_tag_objects[$tag] = new $class_name;
|
return false;
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// compile this tag
|
|
||||||
return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
|
|
||||||
}
|
}
|
||||||
// no internal compile plugin for this tag
|
// compile this tag
|
||||||
return false;
|
return self::$_tag_objects[$tag]->compile($args, $this, $param1, $param2, $param3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user