diff --git a/NEWS b/NEWS index 4f9845b2..d780ad08 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fixed warnings with html_select_date and timestamp + functions (Monte) - added support for sub directory exlusion format (Monte) - added support for grouping by cache_id, compile_id and segments thereof (Monte) diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 0324420e..54ab05e2 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -56,6 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) $field_order = 'MDY'; /* String printed between the different fields. */ $field_separator = "\n"; + $time = time(); extract($params); diff --git a/libs/plugins/shared.make_timestamp.php b/libs/plugins/shared.make_timestamp.php index 19b00900..fb43ba08 100644 --- a/libs/plugins/shared.make_timestamp.php +++ b/libs/plugins/shared.make_timestamp.php @@ -22,8 +22,11 @@ function smarty_make_timestamp($string) return $time; } - // can't decipher, just return it - return $string; + // couldn't recognize it, try to return a time + if ((int) $time > 0) + return (int) $time; + else + return time(); } /* vim: set expandtab: */ diff --git a/plugins/function.html_select_date.php b/plugins/function.html_select_date.php index 0324420e..54ab05e2 100644 --- a/plugins/function.html_select_date.php +++ b/plugins/function.html_select_date.php @@ -56,6 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) $field_order = 'MDY'; /* String printed between the different fields. */ $field_separator = "\n"; + $time = time(); extract($params); diff --git a/plugins/shared.make_timestamp.php b/plugins/shared.make_timestamp.php index 19b00900..fb43ba08 100644 --- a/plugins/shared.make_timestamp.php +++ b/plugins/shared.make_timestamp.php @@ -22,8 +22,11 @@ function smarty_make_timestamp($string) return $time; } - // can't decipher, just return it - return $string; + // couldn't recognize it, try to return a time + if ((int) $time > 0) + return (int) $time; + else + return time(); } /* vim: set expandtab: */