summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--system/helpers/date_helper.php2
-rw-r--r--user_guide/changelog.html1
2 files changed, 2 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;
}
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index e0e2bef36..207c594d0 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -67,6 +67,7 @@ SVN Revision: XXXX</p>
<ul>
<li>Improved accuracy of calculations in <a href="helpers/number_helper.html">Number helper</a>.</li>
<li>Removed added newlines ("\n") from most form and html helper functions.</li>
+ <li>Tightened up validation in Date Helper human_to_unix(), and eliminated the POSIX regex.</li>
</ul>
</li>
<li>Other changes