mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
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
This commit is contained in:
2
NEWS
2
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)
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user