mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
07.02.2012
|
||||||
|
- bugfix increase entropy of internal function names in compiled and cached template files (Forum Topic 20996)
|
||||||
|
|
||||||
06.02.2012
|
06.02.2012
|
||||||
- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
|
- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
|
||||||
- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
|
- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
|
||||||
|
@@ -132,7 +132,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
|
|||||||
if (!isset($compiler->smarty->merged_templates_func[$tpl_name]) || $compiler->inheritance) {
|
if (!isset($compiler->smarty->merged_templates_func[$tpl_name]) || $compiler->inheritance) {
|
||||||
$tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id);
|
$tpl = new $compiler->smarty->template_class ($tpl_name, $compiler->smarty, $compiler->template, $compiler->template->cache_id, $compiler->template->compile_id);
|
||||||
// save unique function name
|
// save unique function name
|
||||||
$compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'.uniqid('', false);
|
$compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'. str_replace('.', '_', uniqid('', true));
|
||||||
// use current nocache hash for inlined code
|
// use current nocache hash for inlined code
|
||||||
$compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
|
$compiler->smarty->merged_templates_func[$tpl_name]['nocache_hash'] = $tpl->properties['nocache_hash'] = $compiler->template->properties['nocache_hash'];
|
||||||
if ($compiler->template->caching) {
|
if ($compiler->template->caching) {
|
||||||
|
@@ -221,7 +221,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->properties['cache_lifetime'] = $this->cache_lifetime;
|
$this->properties['cache_lifetime'] = $this->cache_lifetime;
|
||||||
$this->properties['unifunc'] = 'content_' . uniqid('', false);
|
$this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
|
||||||
$content = $this->createTemplateCodeFrame($content, true);
|
$content = $this->createTemplateCodeFrame($content, true);
|
||||||
$_smarty_tpl = $this;
|
$_smarty_tpl = $this;
|
||||||
eval("?>" . $content);
|
eval("?>" . $content);
|
||||||
@@ -390,12 +390,10 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
|
|||||||
}
|
}
|
||||||
$this->properties['version'] = Smarty::SMARTY_VERSION;
|
$this->properties['version'] = Smarty::SMARTY_VERSION;
|
||||||
if (!isset($this->properties['unifunc'])) {
|
if (!isset($this->properties['unifunc'])) {
|
||||||
$this->properties['unifunc'] = 'content_' . uniqid('', false);
|
$this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
|
||||||
}
|
}
|
||||||
if (!$this->source->recompiled) {
|
if (!$this->source->recompiled) {
|
||||||
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n";
|
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n";
|
||||||
}
|
|
||||||
if (!$this->source->recompiled) {
|
|
||||||
$output .= '<?php if ($_valid && !is_callable(\'' . $this->properties['unifunc'] . '\')) {function ' . $this->properties['unifunc'] . '($_smarty_tpl) {?>';
|
$output .= '<?php if ($_valid && !is_callable(\'' . $this->properties['unifunc'] . '\')) {function ' . $this->properties['unifunc'] . '($_smarty_tpl) {?>';
|
||||||
}
|
}
|
||||||
$output .= $plugins_string;
|
$output .= $plugins_string;
|
||||||
|
Reference in New Issue
Block a user