mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
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:
parent
1cdb9bb61d
commit
064a9019b0
@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user