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