mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-01 17:04:26 +02:00
1
changelog/1034.md
Normal file
1
changelog/1034.md
Normal file
@@ -0,0 +1 @@
|
||||
- Fixed error when using section with nocache [#1034](https://github.com/smarty-php/smarty/issues/1034)
|
@@ -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]);
|
||||
|
@@ -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 = "<?php\n";
|
||||
|
@@ -148,4 +148,10 @@ class CompileSectionTest extends PHPUnit_Smarty
|
||||
);
|
||||
}
|
||||
|
||||
public function testSectionWithNocache()
|
||||
{
|
||||
$source = 'string:{section name=module start=0 loop=1 nocache}{/section}';
|
||||
$this->assertEquals('', $this->smarty->fetch($source));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user