- bugfix inheritance root child templates containing nested {block}{/block} could call sub-bock content from parent

template https://github.com/smarty-php/smarty/issues/317
This commit is contained in:
uwetews
2016-11-19 07:34:06 +01:00
parent 05933749c0
commit 91af9d090a
3 changed files with 6 additions and 2 deletions

View File

@@ -129,7 +129,7 @@ class Smarty_Internal_Runtime_Inheritance
*/
public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null)
{
$block = new $className($name, $tplIndex ? $tplIndex : $this->tplIndex);
$block = new $className($name, isset($tplIndex) ? $tplIndex : $this->tplIndex);
if (isset($this->childRoot[ $name ])) {
$block->child = $this->childRoot[ $name ];
}