From 7290a69a077ada60afe843fa728ce3854971112b Mon Sep 17 00:00:00 2001 From: Arne Blankerts Date: Wed, 6 Mar 2024 16:12:08 +0100 Subject: [PATCH] Fix FormDataRenderer to not choke on unnamed elements --- src/formdata/FormDataRenderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/formdata/FormDataRenderer.php b/src/formdata/FormDataRenderer.php index a305f94..60fab2d 100644 --- a/src/formdata/FormDataRenderer.php +++ b/src/formdata/FormDataRenderer.php @@ -69,7 +69,7 @@ private function processElements(StaticNodeList $elements): void { private function processInput(DOMElement $element): void { $name = $this->nameToLookupKey($element); - if (!$this->form->has($name)) { + if ($name === '' || !$this->form->has($name)) { return; } @@ -102,7 +102,7 @@ private function processInput(DOMElement $element): void { private function processTextArea(DOMElement $element): void { $name = $this->nameToLookupKey($element); - if (!$this->form->has($name)) { + if ($name === '' || !$this->form->has($name)) { return; }