mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-06 03:58:03 +08:00
[更新]修改内容接收解析
This commit is contained in:
parent
3846f79b6d
commit
06ee3506a8
@ -150,7 +150,7 @@ class Tools
|
|||||||
$entity = libxml_disable_entity_loader(true);
|
$entity = libxml_disable_entity_loader(true);
|
||||||
$data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
|
$data = (array)simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||||
libxml_disable_entity_loader($entity);
|
libxml_disable_entity_loader($entity);
|
||||||
return json_decode(self::arr2json($data), true);
|
return json_decode(json_encode($data), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,7 +162,7 @@ class Tools
|
|||||||
{
|
{
|
||||||
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) {
|
return preg_replace_callback('/\\\\u([0-9a-f]{4})/i', function ($matches) {
|
||||||
return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE");
|
return mb_convert_encoding(pack("H*", $matches[1]), "UTF-8", "UCS-2BE");
|
||||||
}, ($jsonData = json_encode($data)) == '[]' ? '{}' : $jsonData);
|
}, ($json = json_encode($data)) == '[]' ? '{}' : $json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,10 @@
|
|||||||
"php": ">=5.4",
|
"php": ">=5.4",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-openssl": "*"
|
"ext-libxml": "*",
|
||||||
|
"ext-openssl": "*",
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"ext-simplexml": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"classmap": [
|
"classmap": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user