From 46b0a6caea88c489b466c369197afc3f80c28976 Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 14 Dec 2001 15:38:03 +0000 Subject: [PATCH] fixed bug in smarty_make_timestamp introduced in PHP 4.1.0 --- NEWS | 1 + Smarty.addons.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 615e507c..182f5607 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fixed bug in smarty_make_timestamp introduced in PHP 4.1.0 (Monte) - fixed bug with cached insert debug timing (Monte) - added 'script' attribute to {insert..} which specifies the script that the insert function can be found in. (Andrei) diff --git a/Smarty.addons.php b/Smarty.addons.php index b83b13d0..790090d3 100644 --- a/Smarty.addons.php +++ b/Smarty.addons.php @@ -113,6 +113,9 @@ function smarty_mod_date_format($string, $format="%b %e, %Y") \*======================================================================*/ function smarty_make_timestamp($string) { + if(empty($string)) { + $string = "now"; + } $time = strtotime($string); if (is_numeric($time) && $time != -1) return $time; @@ -125,7 +128,7 @@ function smarty_make_timestamp($string) return $time; } - // can decipher, must be timestamp already? + // can't decipher, just return it return $string; }