From 6470e6a2c9474c3a3d72a5a6aab95c22bc0e28a0 Mon Sep 17 00:00:00 2001 From: rodneyrehm Date: Thu, 20 Oct 2011 20:28:21 +0000 Subject: [PATCH] - improvement removed unnecessary sha1() (and added previously forgotten templates for ClearCompileTests) --- change_log.txt | 1 + libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_cacheresource_keyvaluestore.php | 2 +- libs/sysplugins/smarty_internal_cacheresource_file.php | 2 +- libs/sysplugins/smarty_internal_template.php | 4 ++-- libs/sysplugins/smarty_internal_utility.php | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/change_log.txt b/change_log.txt index eeabe01b..aad65444 100644 --- a/change_log.txt +++ b/change_log.txt @@ -3,6 +3,7 @@ - @silenced unlink() in Smarty_Internal_Write_File since debuggers go haywire without it. - bugfix Smarty::clearCompiledTemplate() threw an Exception if $cache_id was not present in $compile_dir when $use_sub_dirs = true. - bugfix {html_select_date} and {html_select_time} did not properly handle empty time arguments (Forum Topic 20190) +- improvement removed unnecessary sha1() 19.10.2011 - revert PHP4 constructor message diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 71597023..3cebaa12 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1173,7 +1173,7 @@ class Smarty extends Smarty_Internal_TemplateBase { $compile_id = $compile_id === null ? $this->compile_id : $compile_id; // already in template cache? $unique_template_name = Smarty_Resource::getUniqueTemplateName($this, $template); - $_templateId = sha1($unique_template_name . $cache_id . $compile_id); + $_templateId = $unique_template_name . $cache_id . $compile_id; if ($do_clone) { if (isset($this->template_objects[$_templateId])) { // return cached template object diff --git a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index 2f4ebeac..fff90ea0 100644 --- a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -178,7 +178,7 @@ abstract class Smarty_CacheResource_KeyValueStore extends Smarty_CacheResource { } // remove from template cache - $_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id); + $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id; unset($smarty->template_objects[$_templateId]); } return $uid; diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index c5e985b6..b3ad959f 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -154,7 +154,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource { // remove from template cache $tpl->source; // have the template registered before unset() - $_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id); + $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id; unset($smarty->template_objects[$_templateId]); if ($tpl->source->exists) { diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index a69eb049..cc32e8ab 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -246,7 +246,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { { // already in template cache? $unique_template_name = Smarty_Resource::getUniqueTemplateName($this->smarty, $template); - $_templateId = sha1($unique_template_name . $cache_id . $compile_id); + $_templateId = $unique_template_name . $cache_id . $compile_id; if (isset($this->smarty->template_objects[$_templateId])) { // clone cached template object because of possible recursive call $tpl = clone $this->smarty->template_objects[$_templateId]; @@ -620,7 +620,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase { // cache template object under a unique ID // do not cache eval resources if ($this->source->type != 'eval') { - $_templateId = sha1($this->source->unique_resource . $this->cache_id . $this->compile_id); + $_templateId = $this->source->unique_resource . $this->cache_id . $this->compile_id; $this->smarty->template_objects[$_templateId] = $this; } return $this->source; diff --git a/libs/sysplugins/smarty_internal_utility.php b/libs/sysplugins/smarty_internal_utility.php index 4f25719b..95eddad3 100644 --- a/libs/sysplugins/smarty_internal_utility.php +++ b/libs/sysplugins/smarty_internal_utility.php @@ -192,7 +192,7 @@ class Smarty_Internal_Utility { // remove from template cache $tpl->source; // have the template registered before unset() - $_templateId = sha1($tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id); + $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id; unset($smarty->template_objects[$_templateId]); if ($tpl->source->exists) {