fix regular expression for matching date

This commit is contained in:
mohrt
2002-04-15 13:30:00 +00:00
parent a37433272b
commit d788c4d845
2 changed files with 2 additions and 2 deletions

View File

@@ -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

View File

@@ -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