diff --git a/inc/field/dropdownfield.class.php b/inc/field/dropdownfield.class.php index 5fb5f92cd..13ddc280e 100644 --- a/inc/field/dropdownfield.class.php +++ b/inc/field/dropdownfield.class.php @@ -594,7 +594,7 @@ private function getMyGroups($userID) { } public function equals($value): bool { - $value = html_entity_decode($value); + $value = html_entity_decode($value ?? ''); $itemtype = $this->question->fields['itemtype']; $dropdown = new $itemtype(); if ($dropdown->isNewId($this->value)) { @@ -616,7 +616,7 @@ public function notEquals($value): bool { } public function greaterThan($value): bool { - $value = html_entity_decode($value); + $value = html_entity_decode($value ?? ''); $itemtype = $this->question->fields['itemtype']; $dropdown = new $itemtype(); if (!$dropdown->getFromDB($this->value)) { @@ -635,7 +635,7 @@ public function lessThan($value): bool { } public function regex($value): bool { - $value = html_entity_decode($value); + $value = html_entity_decode($value ?? ''); $itemtype = $this->question->fields['itemtype']; $dropdown = new $itemtype(); if (!$dropdown->getFromDB($this->value)) { diff --git a/inc/field/glpiselectfield.class.php b/inc/field/glpiselectfield.class.php index 8450f7e8d..71a1f67dd 100644 --- a/inc/field/glpiselectfield.class.php +++ b/inc/field/glpiselectfield.class.php @@ -160,7 +160,7 @@ public function buildParams($rand = null) { } public function equals($value): bool { - $value = html_entity_decode($value); + $value = html_entity_decode($value ?? ''); $itemtype = $this->getSubItemtype(); $item = new $itemtype(); if ($item->isNewId($this->value)) { @@ -177,7 +177,7 @@ public function notEquals($value): bool { } public function greaterThan($value): bool { - $value = html_entity_decode($value); + $value = html_entity_decode($value ?? ''); $itemtype = $this->getSubItemtype(); $item = new $itemtype(); if (!$item->getFromDB($this->value)) {