mirror of
https://github.com/smarty-php/smarty.git
synced 2026-05-04 03:40:53 +02:00
-bugfix and enhancement on subtemplate {include} and template {function} tags.
* Calling a template which has a nocache section could fail if it was called from a cached and a not cached subtemplate. * Calling the same subtemplate cached and not cached with the $smarty->merge_compiled_includes enabled could cause problems * Many smaller related changes
This commit is contained in:
@@ -86,7 +86,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
|
||||
*
|
||||
* @return bool true if compiling succeeded, false if it failed
|
||||
*/
|
||||
protected function doCompile($_content)
|
||||
protected function doCompile($_content, $isTemplateSource = false)
|
||||
{
|
||||
/* here is where the compiling takes place. Smarty
|
||||
tags in the templates are replaces with PHP code,
|
||||
@@ -94,6 +94,9 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
|
||||
// init the lexer/parser to compile the template
|
||||
$this->lex = new $this->lexer_class($_content, $this);
|
||||
$this->parser = new $this->parser_class($this->lex, $this);
|
||||
if ($isTemplateSource) {
|
||||
$this->parser->insertPhpCode("<?php\n\$_smarty_tpl->properties['nocache_hash'] = '{$this->nocache_hash}';\n?>\n");
|
||||
}
|
||||
if ($this->inheritance_child) {
|
||||
// start state on child templates
|
||||
$this->lex->yypushstate(Smarty_Internal_Templatelexer::CHILDBODY);
|
||||
|
||||
Reference in New Issue
Block a user