Skip to content

Commit

Permalink
- bugfix multiple {include} with relative filepath within {block}{/bl…
Browse files Browse the repository at this point in the history
…ock} could fail #246
  • Loading branch information
uwetews committed Jul 18, 2016
1 parent 5fd21b7 commit 09d8eab
Showing 1 changed file with 1 addition and 38 deletions.
39 changes: 1 addition & 38 deletions libs/sysplugins/smarty_internal_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -223,15 +223,13 @@ public function render($no_output_filter = true, $display = null)
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) {
$this->parent->compiled->required_plugins[ $code ][ $name ][ $type ] = $data;
}
}
}
* **/
}
if (!$no_output_filter &&
(!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&
Expand Down Expand Up @@ -382,41 +380,6 @@ public function _subTemplateRegister()
}
}

/**
* 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
*
Expand Down

0 comments on commit 09d8eab

Please sign in to comment.