diff options
author | Jason Oster <parasytic@users.sourceforge.net> | 2009-02-05 15:34:44 +0000 |
---|---|---|
committer | Jason Oster <parasytic@users.sourceforge.net> | 2009-02-05 15:34:44 +0000 |
commit | 9a5a29d288288ae71b13eafbbcb9024648a25f88 (patch) | |
tree | b32fee1b926d9a596ce01a529a1f7d82f0853272 /functions/date_functions.php | |
parent | 360e2501d58ea518d7de230cc4718e8754f550ee (diff) | |
download | phpicalendar-9a5a29d288288ae71b13eafbbcb9024648a25f88.tar.gz phpicalendar-9a5a29d288288ae71b13eafbbcb9024648a25f88.tar.bz2 phpicalendar-9a5a29d288288ae71b13eafbbcb9024648a25f88.zip |
Fix dates before 1970: Patch #2549612
Diffstat (limited to 'functions/date_functions.php')
-rw-r--r-- | functions/date_functions.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php index 5a80cb2..61836a0 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -249,7 +249,7 @@ function extractDateTime($data, $property, $field) { // Pull out the date value. Minimum year is 1970. ereg ('([0-9]{4})([0-9]{2})([0-9]{2})', $data, $dt_check); if ($dt_check[1] < 1970) { - $data = '1971'.$dt_check[2].$dt_check[3]; + $dt_check[1] = '1970'; } # convert to date-time $data = $dt_check[1].$dt_check[2].$dt_check[3]."T000000"; @@ -261,7 +261,7 @@ function extractDateTime($data, $property, $field) { preg_match ('/([0-9]{4})([0-9]{2})([0-9]{2})T{0,1}([0-9]{0,2})([0-9]{0,2})/', $data, $regs); if (!isset ($regs[1])) return; if ($regs[1] < 1970) { - $regs[1] = '1971'; + $regs[1] = '1970'; } $date = $regs[1] . $regs[2] . $regs[3]; $time = $regs[4] . $regs[5]; |