From e865374fc2097e3cc15ef0f2efc72b7b967fa2b4 Mon Sep 17 00:00:00 2001 From: uwetews Date: Tue, 19 Jul 2016 00:19:22 +0200 Subject: [PATCH] - bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246 (reverted from commit 09d8eab89ff7faf40f28656b0d8b5bb50dd85f26) (reverted from commit 3fdd9e4b895db3c4a5dc1b220f2c80fad1f7e6b1) --- libs/sysplugins/smarty_internal_template.php | 39 +------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index b5f825fb..dfb9ed3e 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -42,7 +42,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase /** * Source instance * - * @var \Smarty_Template_Source|\Smarty_Template_Config + * @var Smarty_Template_Source|Smarty_Template_Config */ public $source = null; @@ -223,7 +223,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase if (!empty($this->tpl_function)) { $this->parent->tpl_function = array_merge($this->parent->tpl_function, $this->tpl_function); } - /** foreach ($this->compiled->required_plugins as $code => $tmp1) { foreach ($tmp1 as $name => $tmp) { foreach ($tmp as $type => $data) { @@ -231,7 +230,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } } } - * **/ } if (!$no_output_filter && (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && @@ -382,41 +380,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase } } - /** - * Call plugin - * - * @param array $params parameter array - * @param string $type plugin type - * @param string $pluginName plugin name - * - * @return mixed - * @throws \SmartyException - */ - public function _executePlugin($params, $type, $pluginName, $content = null, &$repeat = null) - { - if (isset($this->smarty->_pluginCache[ $pluginName ][ $type ])) { - $callback = $this->smarty->_pluginCache[ $pluginName ][ $type ][0]; - } else { - $pluginInfo = $this->smarty->_getPluginInfo($type, $pluginName); - if ($pluginInfo === false) { - throw new SmartyException("plugin '{$pluginName}' not callable"); - } - $callback = $pluginInfo[0]; - } - if ($type == Smarty::PLUGIN_MODIFIER) { - return call_user_func_array($callback, $params); - } else if ($type == Smarty::PLUGIN_BLOCK) { - if (!is_array($callback)) { - return $callback($params, $content, $this, $repeat); - } else if (is_object($callback[0])){ - return $callback[0]->{$callback[1]}($params, $content, $this, $repeat); - } else { - return $callback[0]::{$callback[1]}($params, $content, $this, $repeat); - } - } - return call_user_func_array($callback, array($params, $this)); - } - /** * Check if parent is template object *