- bugfix different behaviour of uniqid() on cygwin. See https://bugs.php.net/bug.php?id=34908

(forum topic 20199)
This commit is contained in:
uwe.tews@googlemail.com
2011-11-09 15:30:06 +00:00
parent a061bc47d1
commit 555a7fceb9
3 changed files with 7 additions and 3 deletions

View File

@@ -1,4 +1,8 @@
===== trunk ===== ===== trunk =====
09.11.2011
- bugfix different behaviour of uniqid() on cygwin. See https://bugs.php.net/bug.php?id=34908
(forum topic 20199)
01.11.2011 01.11.2011
- bugfix {if} and {while} tags without condition did not throw a SmartyCompilerException (Issue #57) - bugfix {if} and {while} tags without condition did not throw a SmartyCompilerException (Issue #57)
- bugfix multiline strings in config files could fail on longer strings (reopened Issue #55) - bugfix multiline strings in config files could fail on longer strings (reopened Issue #55)

View File

@@ -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(); $compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'.uniqid('', false);
// 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) {

View File

@@ -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(); $this->properties['unifunc'] = 'content_' . uniqid('', false);
$content = $this->createTemplateCodeFrame($content, true); $content = $this->createTemplateCodeFrame($content, true);
$_smarty_tpl = $this; $_smarty_tpl = $this;
eval("?>" . $content); eval("?>" . $content);
@@ -390,7 +390,7 @@ 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(); $this->properties['unifunc'] = 'content_' . uniqid('', false);
} }
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";