easywechat4.x升级到6.x
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user