summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-08-07 02:01:09 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-08-07 02:01:09 +0200
commit17756a07a877436d520edb87813e13b860ace169 (patch)
tree0beaf8d3406a400ab2fb0097603a0c310f678f66 /system
parent30e9c533700ef014d4c3ff513bc7dd1a2b5c2309 (diff)
tightened human time stamp validation regex
Diffstat (limited to 'system')
-rw-r--r--system/helpers/date_helper.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 095e460a9..a82450aa1 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -442,7 +442,7 @@ if ( ! function_exists('human_to_unix'))
$datestr = trim($datestr);
$datestr = preg_replace("/\040+/", "\040", $datestr);
- if ( ! ereg("^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\040[0-9]{1,2}:[0-9]{1,2}.*$", $datestr))
+ if ( ! preg_match('/^[0-9]{2,4}\-[0-9]{1,2}\-[0-9]{1,2}\s[0-9]{1,2}:[0-9]{1,2}(?::[0-9]{1,2})?(?:\s[AP]M)?$/i', $datestr))
{
return FALSE;
}