From 631e3023ccacf9f5b71a71110016e8af7f7e64b0 Mon Sep 17 00:00:00 2001 From: "Uwe.Tews" Date: Fri, 20 Nov 2009 21:49:20 +0000 Subject: [PATCH] - bugfix for empty config files - convert timestamps of registered resources to integer --- change_log.txt | 4 ++++ libs/sysplugins/smarty_internal_config_file_compiler.php | 2 +- libs/sysplugins/smarty_internal_resource_registered.php | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/change_log.txt b/change_log.txt index 688707ff..e79bb457 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,7 @@ +11/20/2009 +- bugfix for empty config files +- convert timestamps of registered resources to integer + 11/19/2009 - compiled templates are no longer touched with the filemtime of template source diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php index 796bace2..8c530100 100644 --- a/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -41,7 +41,7 @@ class Smarty_Internal_Config_File_Compiler { then written to compiled files. */ $this->config = $config; // get config file source - $_content = $config->getConfigSource(); + $_content = $config->getConfigSource()."\n"; // on empty template just return if ($_content == '') { return true; diff --git a/libs/sysplugins/smarty_internal_resource_registered.php b/libs/sysplugins/smarty_internal_resource_registered.php index 43fa0e04..e24b5e3d 100644 --- a/libs/sysplugins/smarty_internal_resource_registered.php +++ b/libs/sysplugins/smarty_internal_resource_registered.php @@ -63,7 +63,7 @@ class Smarty_Internal_Resource_Registered { $time_stamp = false; call_user_func_array($this->smarty->_plugins['resource'][$_template->resource_type][0][1], array($_template->resource_name, &$time_stamp, $this->smarty)); - return $time_stamp; + return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp; } /** * Get timestamp to template source by type and name @@ -77,7 +77,7 @@ class Smarty_Internal_Resource_Registered { $time_stamp = false; call_user_func_array($this->smarty->_plugins['resource'][$_resource_type][0][1], array($_resource_name, &$time_stamp, $this->smarty)); - return $time_stamp; + return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp; } /**