easywechat4.x升级到6.x

This commit is contained in:
Dev
2026-09-21 14:57:50 +08:00
parent 39882c6cf2
commit 5f4c8147ca
11 changed files with 263 additions and 185 deletions
@@ -130,8 +130,10 @@ class ToolService
throw new \Exception("xml数据异常!");
}
//将XML转为array
//禁止引用外部xml实体
libxml_disable_entity_loader(true);
//禁止引用外部xml实体(libxml 2.9+已默认禁用,PHP8起该函数已废弃)
if (PHP_VERSION_ID < 80000) {
libxml_disable_entity_loader(true);
}
$values = json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true);
return $values;
}