From b8ce7be2fa53e13d56c335306c6b6243cf874607 Mon Sep 17 00:00:00 2001 From: KingRainy Date: Fri, 18 Jun 2021 16:56:03 +0800 Subject: [PATCH] Update Utility.php --- src/WeChat/Utility.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WeChat/Utility.php b/src/WeChat/Utility.php index 738354c..45aa5d5 100644 --- a/src/WeChat/Utility.php +++ b/src/WeChat/Utility.php @@ -137,7 +137,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); } @@ -155,4 +155,4 @@ public function decryptRefundContents($contents) OPENSSL_RAW_DATA ); } -} \ No newline at end of file +}