Skip to content

Commit

Permalink
Fix handling null in to_xml()
Browse files Browse the repository at this point in the history
  • Loading branch information
ipeevski authored and chriskacerguis committed Sep 11, 2024
1 parent 94c779f commit bdf3548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function to_xml($data = null, $structure = null, $basenode = 'xml')
$this->to_xml($value, $node, $key);
} else {
// add single node.
$value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');
$value = htmlspecialchars(html_entity_decode($value ?? '', ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8');

$structure->addChild($key, $value);
}
Expand Down

0 comments on commit bdf3548

Please sign in to comment.