Benchanything's picture
Add 300 CheckerBench tasks, dataset card, and restoration tools (part 3)
8247f19 verified
Raw History Blame Contribute Delete
938 Bytes
diff --git a/weixin/msg.py b/weixin/msg.py
index cb4e74a..89806b0 100644
--- a/weixin/msg.py
+++ b/weixin/msg.py
@@ -64,7 +64,8 @@ class WeixinMsg(object):
def parse(self, content):
raw = {}
- root = etree.fromstring(content)
+ root = etree.fromstring(content,
+ parser=etree.XMLParser(resolve_entities=False))
for child in root:
raw[child.tag] = child.text
diff --git a/weixin/pay.py b/weixin/pay.py
index 4ab8cfb..1f8e231 100644
--- a/weixin/pay.py
+++ b/weixin/pay.py
@@ -79,7 +79,8 @@ class WeixinPay(object):
def to_dict(self, content):
raw = {}
- root = etree.fromstring(content.encode("utf-8"))
+ root = etree.fromstring(content.encode("utf-8"),
+ parser=etree.XMLParser(resolve_entities=False))
for child in root:
raw[child.tag] = child.text
return raw