From d788c4d84519af67c858bf62b4d7bd9f368c3ced Mon Sep 17 00:00:00 2001 From: mohrt Date: Mon, 15 Apr 2002 13:30:00 +0000 Subject: [PATCH] fix regular expression for matching date --- libs/plugins/function.html_select_date.php | 2 +- plugins/function.html_select_date.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 3b2fd01b..94ba9229 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -56,7 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) extract($params); // 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 // using smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd diff --git a/plugins/function.html_select_date.php b/plugins/function.html_select_date.php index 3b2fd01b..94ba9229 100644 --- a/plugins/function.html_select_date.php +++ b/plugins/function.html_select_date.php @@ -56,7 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) extract($params); // 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 // using smarty_make_timestamp to get an unix timestamp and // strftime to make yyyy-mm-dd