mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fix regular expression for matching date
This commit is contained in:
@@ -56,7 +56,7 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
extract($params);
|
extract($params);
|
||||||
|
|
||||||
// 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)) {
|
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $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
|
||||||
|
@@ -56,7 +56,7 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
extract($params);
|
extract($params);
|
||||||
|
|
||||||
// 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)) {
|
if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $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