- small performace patch in Smarty class

This commit is contained in:
uwe.tews@googlemail.com
2010-11-14 18:46:18 +00:00
parent 7135787127
commit d2cafef753
2 changed files with 5 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
- bugfix isset() did not allow multiple parameter - bugfix isset() did not allow multiple parameter
- improvment of some error messages - improvment of some error messages
- bugfix html_image did use removed property $request_use_auto_globals - bugfix html_image did use removed property $request_use_auto_globals
- small performace patch in Smarty class
13/11/2010 13/11/2010
- bugfix overloading problem when $smarty->fetch()/display() have been used in plugins - bugfix overloading problem when $smarty->fetch()/display() have been used in plugins

View File

@@ -305,7 +305,7 @@ class Smarty extends Smarty_Internal_Data {
*/ */
public function fetch($template, $cache_id = null, $compile_id = null, $parent = null, $display = false) public function fetch($template, $cache_id = null, $compile_id = null, $parent = null, $display = false)
{ {
if (is_object($cache_id)) { if (!empty($cache_id) && is_object($cache_id)) {
$parent = $cache_id; $parent = $cache_id;
$cache_id = null; $cache_id = null;
} }
@@ -422,11 +422,11 @@ class Smarty extends Smarty_Internal_Data {
*/ */
public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null) public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null)
{ {
if (is_object($cache_id) || is_array($cache_id)) { if (!empty($cache_id) && (is_object($cache_id) || is_array($cache_id))) {
$parent = $cache_id; $parent = $cache_id;
$cache_id = null; $cache_id = null;
} }
if (is_array($parent)) { if (!empty($parent) && is_array($parent)) {
$data = $parent; $data = $parent;
$parent = null; $parent = null;
} else { } else {
@@ -448,7 +448,7 @@ class Smarty extends Smarty_Internal_Data {
$tpl = $template; $tpl = $template;
} }
// fill data if present // fill data if present
if (is_array($data)) { if (!empty($data) && is_array($data)) {
// set up variable values // set up variable values
foreach ($data as $_key => $_val) { foreach ($data as $_key => $_val) {
$tpl->tpl_vars[$_key] = new Smarty_variable($_val); $tpl->tpl_vars[$_key] = new Smarty_variable($_val);