Skip to content

Commit

Permalink
Update DOMNodeComparator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rdex committed Jul 10, 2020
1 parent b6fa5a2 commit b89b034
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/DOMNodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ private function nodeToText(DOMNode $node, bool $canonicalize, bool $ignoreCase)
{
if ($canonicalize) {
$document = new DOMDocument;
@$document->loadXML('<?xml version="1.0" encoding="' . $node->ownerDocument->encoding . '"?>' . \PHP_EOL . $node->C14N());
@$document->loadXML(
'<?xml version="1.0" encoding="' . ($node->ownerDocument->encoding ?: 'UTF-8') . '"?>' . \PHP_EOL
. $node->C14N()
);

$node = $document;
}
Expand Down

0 comments on commit b89b034

Please sign in to comment.