From 91af9d090ab7ed5f73d325eb5706dd7dec236b9a Mon Sep 17 00:00:00 2001 From: uwetews Date: Sat, 19 Nov 2016 07:34:06 +0100 Subject: [PATCH] - 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 --- change_log.txt | 4 ++++ libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_runtime_inheritance.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index 19facf61..eb8d6133 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== 3.1.31-dev ===== (xx.xx.xx) + 19.11.2016 + - 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 + 11.11.2016 - bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data must be removed https://github.com/smarty-php/smarty/issues/312 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1989c73a..c247ac6e 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -108,7 +108,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.31-dev/44'; + const SMARTY_VERSION = '3.1.31-dev/45'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_runtime_inheritance.php b/libs/sysplugins/smarty_internal_runtime_inheritance.php index 66c38407..7ec5924e 100644 --- a/libs/sysplugins/smarty_internal_runtime_inheritance.php +++ b/libs/sysplugins/smarty_internal_runtime_inheritance.php @@ -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 ]; }