little cleaner regex in human_to_unix()
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 0e97816..2c60f03 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -288,7 +288,7 @@
return $days_in_month[$month - 1];
}
}
-
+
// ------------------------------------------------------------------------
/**
@@ -343,7 +343,7 @@
return $time;
}
}
-
+
// ------------------------------------------------------------------------
/**
@@ -440,14 +440,14 @@
}
$datestr = trim($datestr);
- $datestr = preg_replace("/\040+/", "\040", $datestr);
-
+ $datestr = preg_replace("/\040+/", ' ', $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;
}
-
- $split = preg_split("/\040/", $datestr);
+
+ $split = explode(' ', $datestr);
$ex = explode("-", $split['0']);