Skip to content

Commit bdf3548

Browse files
ipeevskichriskacerguis
authored andcommitted
Fix handling null in to_xml()
1 parent 94c779f commit bdf3548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Format.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ public function to_xml($data = null, $structure = null, $basenode = 'xml')
215215
$this->to_xml($value, $node, $key);
216216
} else {
217217
// add single node.
218-
$value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
218+
$value = htmlspecialchars(html_entity_decode($value ?? '', ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
219219

220220
$structure->addChild($key, $value);
221221
}

0 commit comments

Comments
 (0)