Skip to content

Commit

Permalink
Merge pull request #47 from kingrainy/master
Browse files Browse the repository at this point in the history
libxml_disable_entity_loader 兼容 php8
  • Loading branch information
tioncico authored Jun 25, 2021
2 parents ac15b01 + b8ce7be commit 1ca1af8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WeChat/Utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function fromXML($xml): array
if (!$xml) {
throw new InvalidArgumentException('Convert To Array Error! Invalid Xml!');
}
libxml_disable_entity_loader(true);
if (\PHP_VERSION_ID < 80000 || \LIBXML_VERSION < 20900) libxml_disable_entity_loader(true);
return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
}

Expand Down

0 comments on commit 1ca1af8

Please sign in to comment.