Skip to content

Commit

Permalink
Update XMLReader.php
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Jan 11, 2018
1 parent 8b8bac2 commit fbf9633
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/XMLReader/XMLReader.php
Expand Up @@ -294,9 +294,18 @@ protected function addNodeWithKey($key, DOMElement $element, $storage)
}
else if ($key === '@value')
{

if (\is_object($storage) && $storage instanceof CData)
{
$fragment = $element->ownerDocument->createDocumentFragment();
$fragment->appendXML((string)$storage);
$element->appendChild($fragment);
return;
}

if (\is_string($storage))
{
$element->nodeValue = \htmlspecialchars($storage);
$element->nodeValue = $storage;

return;
}
Expand Down

0 comments on commit fbf9633

Please sign in to comment.