Skip to content

Commit

Permalink
ensure data is a string while creating xml text node
Browse files Browse the repository at this point in the history
  • Loading branch information
alekitto committed Jan 20, 2021
1 parent 96b7c4a commit b430aa1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/XmlSerializationVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,9 @@ public function getResult()

private function createTextNode($data, bool $cdata = false)
{
$data = (string) $data;
if (! $cdata) {
return $this->document->createTextNode((string) $data);
return $this->document->createTextNode($data);
}

return $this->document->createCDATASection($data);
Expand Down

0 comments on commit b430aa1

Please sign in to comment.