mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +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()
|
public function getNullifyEmpty()
|
||||||
{
|
{
|
||||||
return $this->options['nullifyEmpty'];
|
return !empty($this->options['nullifyEmpty']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,7 +99,7 @@ abstract class DBString extends DBField
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Return "empty" value
|
// Return "empty" value
|
||||||
if ($this->options['nullifyEmpty'] || $value === null) {
|
if ($this->getNullifyEmpty() || $value === null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
|
Loading…
Reference in New Issue
Block a user