- bugfix smarty_make_timestamp() failed to process DateTime objects properly

This commit is contained in:
rodneyrehm
2011-09-27 18:16:03 +00:00
parent 0348e71109
commit ae85a298d8
2 changed files with 2 additions and 1 deletions

View File

@@ -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

View File

@@ -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),