We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d89f7d2 commit 0943a06Copy full SHA for 0943a06
Encoder/XmlEncoder.php
@@ -54,7 +54,18 @@ public function encode($data, $format)
54
*/
55
public function decode($data, $format)
56
{
57
+ $internalErrors = libxml_use_internal_errors(true);
58
+ $disableEntities = libxml_disable_entity_loader(true);
59
+ libxml_clear_errors();
60
+
61
$xml = simplexml_load_string($data);
62
+ libxml_use_internal_errors($internalErrors);
63
+ libxml_disable_entity_loader($disableEntities);
64
65
+ if ($error = libxml_get_last_error()) {
66
+ throw new UnexpectedValueException($error->message);
67
+ }
68
69
if (!$xml->count()) {
70
if (!$xml->attributes()) {
71
return (string) $xml;
0 commit comments