mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- fixed bug on modifier plugins at nocache output
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
- code cleanup for merging compiled templates
|
||||
- couple of runtime optimizations (still not all done)
|
||||
- update of getCachedTimestamp()
|
||||
- fixed bug on modifier plugins at nocache output
|
||||
|
||||
12/19/2009
|
||||
- bugfix on comment lines in config files
|
||||
|
@@ -266,6 +266,13 @@ class Smarty_Internal_TemplateCompilerBase {
|
||||
if (isset($this->template->required_plugins['compiled'][$plugin_name])) {
|
||||
$this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
|
||||
}
|
||||
} else {
|
||||
if (isset($this->template->required_plugins['cache'][$plugin_name])) {
|
||||
$this->template->required_plugins['compiled'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
|
||||
}
|
||||
}
|
||||
if ($type = 'modifier') {
|
||||
$this->template->saved_modifer[$plugin_name] = true;
|
||||
}
|
||||
return $this->template->required_plugins_call[$plugin_name][$type];
|
||||
}
|
||||
@@ -290,6 +297,10 @@ class Smarty_Internal_TemplateCompilerBase {
|
||||
$this->template->required_plugins['compiled'][$plugin_name]['file'] = $file;
|
||||
$this->template->required_plugins['compiled'][$plugin_name]['type'] = $type;
|
||||
}
|
||||
if ($type = 'modifier') {
|
||||
$this->template->saved_modifer[$plugin_name] = true;
|
||||
}
|
||||
|
||||
return $plugin;
|
||||
} else {
|
||||
throw new Exception("Plugin {$type} \"{$plugin_name}\" not callable");
|
||||
@@ -319,6 +330,15 @@ class Smarty_Internal_TemplateCompilerBase {
|
||||
$this->tag_nocache = false;
|
||||
$_output = str_replace("'", "\'", $content);
|
||||
$_output = "<?php echo '/*%%SmartyNocache%%*/" . $_output . "/*/%%SmartyNocache%%*/';?>\n";
|
||||
// make sure we include modifer plugins for nocache code
|
||||
if (isset($this->template->saved_modifer)) {
|
||||
foreach ($this->template->saved_modifer as $plugin_name => $dummy) {
|
||||
if (isset($this->template->required_plugins['compiled'][$plugin_name])) {
|
||||
$this->template->required_plugins['cache'][$plugin_name] = $this->template->required_plugins['compiled'][$plugin_name];
|
||||
}
|
||||
}
|
||||
unset($this->template->saved_modifer);
|
||||
}
|
||||
} else {
|
||||
$_output = $content;
|
||||
}
|
||||
|
Reference in New Issue
Block a user