fix date_format modifier, return nothing if given empty string

This commit is contained in:
mohrt
2002-06-19 14:25:01 +00:00
parent fdd23e161b
commit 2e1cd4a5d0
2 changed files with 10 additions and 2 deletions

View File

@@ -11,7 +11,11 @@
require_once SMARTY_DIR . $this->plugins_dir . '/shared.make_timestamp.php';
function smarty_modifier_date_format($string, $format="%b %e, %Y")
{
return strftime($format, smarty_make_timestamp($string));
if($string != '') {
return strftime($format, smarty_make_timestamp($string));
} else {
return;
}
}
/* vim: set expandtab: */

View File

@@ -11,7 +11,11 @@
require_once SMARTY_DIR . $this->plugins_dir . '/shared.make_timestamp.php';
function smarty_modifier_date_format($string, $format="%b %e, %Y")
{
return strftime($format, smarty_make_timestamp($string));
if($string != '') {
return strftime($format, smarty_make_timestamp($string));
} else {
return;
}
}
/* vim: set expandtab: */