From ae85a298d82c01a67b1fd5daa40538d40a164adc Mon Sep 17 00:00:00 2001 From: rodneyrehm Date: Tue, 27 Sep 2011 18:16:03 +0000 Subject: [PATCH] - bugfix smarty_make_timestamp() failed to process DateTime objects properly --- change_log.txt | 1 + libs/plugins/shared.make_timestamp.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index 14555b9d..d75004bc 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,7 @@ - added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now - bugfix remove race condition when a custom resource did change timestamp during compilation - bugfix variable property did not work on objects variable in template +- bugfix smarty_make_timestamp() failed to process DateTime objects properly 26.09.2011 - bugfix repeated calls to same subtemplate did not make use of cached template object diff --git a/libs/plugins/shared.make_timestamp.php b/libs/plugins/shared.make_timestamp.php index b0a2d0d1..5d7c97e9 100644 --- a/libs/plugins/shared.make_timestamp.php +++ b/libs/plugins/shared.make_timestamp.php @@ -20,7 +20,7 @@ function smarty_make_timestamp($string) // use "now": return time(); } elseif ($string instanceof DateTime) { - return $string->source->timestamp; + return $string->getTimestamp(); } elseif (strlen($string) == 14 && ctype_digit($string)) { // it is mysql timestamp format of YYYYMMDDHHMMSS? return mktime(substr($string, 8, 2),substr($string, 10, 2),substr($string, 12, 2),