From 331c2ef286c1d87d5cb28527e0197c8d036e63df Mon Sep 17 00:00:00 2001 From: messju Date: Wed, 17 Dec 2003 09:32:30 +0000 Subject: [PATCH] allow single-digit days and months without smarty_make_timestamp() this makes dates like "1968-11-6" work correctly since no strtotime() is involved add warning when unknown parameter is passed --- NEWS | 2 ++ libs/plugins/function.html_select_date.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5325af33..f2d3c417 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - allow single-digit days and months without smarty_make_timestamp() + in html_select_date (messju) - fix headers sent erroneously with cache_modified_check and fetch() (wphilips, messju) - fix config_file path bug (Marc Cabadas, Monte) diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 61d4d634..d9f39e8d 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -115,11 +115,15 @@ function smarty_function_html_select_date($params, &$smarty) case 'reverse_years': $$_key = (bool)$_value; break; + + default: + $smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING); + } } // If $time is not in format yyyy-mm-dd - if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $time) && $time!='--') { + if (!preg_match('/^\d{4}-\d{1,2}-\d{1,2}$/', $time) && $time!='--') { // then $time is empty or unix timestamp or mysql timestamp // using smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd