- bugfix Smarty failed when executing PHP on HHVM (Hip Hop 2.4) because uniqid('',true) does return string with ',' (forum topic 20343)

This commit is contained in:
Uwe.Tews@googlemail.com
2014-02-17 18:21:31 +00:00
parent bfa0ce8ba4
commit f06013927c
5 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -217,7 +217,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
return false;
}
$this->properties['cache_lifetime'] = $this->cache_lifetime;
$this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
$this->properties['unifunc'] = 'content_' . str_replace(array('.',','), '_', uniqid('', true));
$content = $this->createTemplateCodeFrame($content, true);
$_smarty_tpl = $this;
eval("?>" . $content);
@@ -399,7 +399,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
}
$this->properties['version'] = Smarty::SMARTY_VERSION;
if (!isset($this->properties['unifunc'])) {
$this->properties['unifunc'] = 'content_' . str_replace('.', '_', uniqid('', true));
$this->properties['unifunc'] = 'content_' . str_replace(array('.',','), '_', uniqid('', true));
}
if (!$this->source->recompiled) {
$output .= "\$_valid = \$_smarty_tpl->decodeProperties(" . var_export($this->properties, true) . ',' . ($cache ? 'true' : 'false') . "); /*/%%SmartyHeaderCode%%*/?>\n";