Skip to content

Commit da8bcee

Browse files
authored
Convertor: Use automatic input normalization.
1 parent ede30be commit da8bcee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Convertor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static function covertToArray(string $xml): array
1717
{
1818
assert(\class_exists('\DOMDocument'));
1919
$doc = new \DOMDocument();
20-
$doc->loadXML($xml);
20+
$doc->loadXML(str_replace(["\r\n", "\r"], "\n", trim($xml)));
2121
$root = $doc->documentElement;
2222
$output = (array) Helper::domNodeToArray($root);
2323
$output['@root'] = $root->tagName;

0 commit comments

Comments
 (0)