BUGFIX: Make sure date is a string before trying to use strtotime

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@68834 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2008-12-14 22:35:37 +00:00 committed by Sam Minnee
parent 1cdb9bb61d
commit 064a9019b0

View File

@ -16,7 +16,7 @@ class Date extends DBField {
if(ereg('^([0-9]+)/([0-9]+)/([0-9]+)$', $value, $parts))
$value = "$parts[2]/$parts[1]/$parts[3]";
if($value) $this->value = date('Y-m-d', strtotime($value));
if($value && is_string($value)) $this->value = date('Y-m-d', strtotime($value));
else $value = null;
}
@ -258,4 +258,4 @@ class Date extends DBField {
}
}
?>
?>