mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 13:19:11 +02:00
FIX Protect against undefined index when using nullifyEmpty option
This commit is contained in:
parent
054dbd6ae5
commit
c76d3a5db1
@ -77,7 +77,7 @@ abstract class DBString extends DBField
|
||||
*/
|
||||
public function getNullifyEmpty()
|
||||
{
|
||||
return $this->options['nullifyEmpty'];
|
||||
return !empty($this->options['nullifyEmpty']);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -99,7 +99,7 @@ abstract class DBString extends DBField
|
||||
}
|
||||
|
||||
// Return "empty" value
|
||||
if ($this->options['nullifyEmpty'] || $value === null) {
|
||||
if ($this->getNullifyEmpty() || $value === null) {
|
||||
return null;
|
||||
}
|
||||
return '';
|
||||
|
Loading…
Reference in New Issue
Block a user