代码同步
This commit is contained in:
@@ -8,14 +8,14 @@ class XML
|
||||
{
|
||||
$res = self::parse($xmlStr);
|
||||
if ($response === null) {
|
||||
return $ref;
|
||||
return $res;
|
||||
} else {
|
||||
if (\is_string($response)) {
|
||||
$response = new $response();
|
||||
}
|
||||
$prop = get_object_vars($response);
|
||||
$target = [];
|
||||
|
||||
|
||||
foreach ($res as $k => $v) {
|
||||
if (isset($prop[$k])) {
|
||||
$target[$k] = $v;
|
||||
@@ -45,7 +45,9 @@ class XML
|
||||
|
||||
private static function parse($xml)
|
||||
{
|
||||
libxml_disable_entity_loader(true);
|
||||
if (\PHP_VERSION_ID < 80000) {
|
||||
libxml_disable_entity_loader(true);
|
||||
}
|
||||
|
||||
return json_decode(
|
||||
json_encode(
|
||||
|
||||
Reference in New Issue
Block a user