diff --git a/changelog/1034.md b/changelog/1034.md new file mode 100644 index 00000000..1c14a860 --- /dev/null +++ b/changelog/1034.md @@ -0,0 +1 @@ +- Fixed error when using section with nocache [#1034](https://github.com/smarty-php/smarty/issues/1034) \ No newline at end of file diff --git a/src/Compile/Tag/Section.php b/src/Compile/Tag/Section.php index f82ac421..13659117 100644 --- a/src/Compile/Tag/Section.php +++ b/src/Compile/Tag/Section.php @@ -99,7 +99,7 @@ class Section extends ForeachSection { if ($compiler->tag_nocache) { // push a {nocache} tag onto the stack to prevent caching of this block - $this->openTag('nocache'); + $this->openTag($compiler, 'nocache'); } $this->openTag($compiler, 'section', ['section', $compiler->tag_nocache]); diff --git a/src/Compile/Tag/SectionClose.php b/src/Compile/Tag/SectionClose.php index efab6097..24c79c32 100644 --- a/src/Compile/Tag/SectionClose.php +++ b/src/Compile/Tag/SectionClose.php @@ -33,7 +33,7 @@ class SectionClose extends Base { if ($nocache_pushed) { // pop the pushed virtual nocache tag - $this->closeTag('nocache'); + $this->closeTag($compiler, 'nocache'); } $output = "assertEquals('', $this->smarty->fetch($source)); + } + }