mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44: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()
|
- fix headers sent erroneously with cache_modified_check and fetch()
|
||||||
(wphilips, messju)
|
(wphilips, messju)
|
||||||
- fix config_file path bug (Marc Cabadas, Monte)
|
- fix config_file path bug (Marc Cabadas, Monte)
|
||||||
|
@@ -115,11 +115,15 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
case 'reverse_years':
|
case 'reverse_years':
|
||||||
$$_key = (bool)$_value;
|
$$_key = (bool)$_value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If $time is not in format yyyy-mm-dd
|
// 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
|
// then $time is empty or unix timestamp or mysql timestamp
|
||||||
// using smarty_make_timestamp to get an unix timestamp and
|
// using smarty_make_timestamp to get an unix timestamp and
|
||||||
// strftime to make yyyy-mm-dd
|
// strftime to make yyyy-mm-dd
|
||||||
|
Reference in New Issue
Block a user