From c76d3a5db10f9a56a31684354fcd89c1a88de8d4 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Wed, 26 Jun 2019 09:26:36 +1200 Subject: [PATCH] FIX Protect against undefined index when using nullifyEmpty option --- src/ORM/FieldType/DBString.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ORM/FieldType/DBString.php b/src/ORM/FieldType/DBString.php index d40481dd7..5c40ac337 100644 --- a/src/ORM/FieldType/DBString.php +++ b/src/ORM/FieldType/DBString.php @@ -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 '';