Skip to content

Commit

Permalink
修复由于xstream升级后导致xml源解析失败的问题,报错:ForbiddenClassException
Browse files Browse the repository at this point in the history
  • Loading branch information
CandyMuj authored and takagen99 committed Sep 25, 2023
1 parent 7c83c17 commit 32e9b4b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ private AbsSortXml sortXml(MutableLiveData<AbsSortXml> result, String xml) {
xstream.autodetectAnnotations(true);
xstream.processAnnotations(AbsSortXml.class);
xstream.ignoreUnknownElements();
xstream.allowTypes(new Class[]{AbsSortXml.class});
AbsSortXml data = (AbsSortXml) xstream.fromXML(xml);
for (MovieSort.SortData sort : data.classes.sortList) {
if (sort.filters == null) {
Expand Down Expand Up @@ -919,6 +920,7 @@ private AbsXml xml(MutableLiveData<AbsXml> result, String xml, String sourceKey)
xstream.autodetectAnnotations(true);
xstream.processAnnotations(AbsXml.class);
xstream.ignoreUnknownElements();
xstream.allowTypes(new Class[]{AbsXml.class});
if (xml.contains("<year></year>")) {
xml = xml.replace("<year></year>", "<year>0</year>");
}
Expand Down

0 comments on commit 32e9b4b

Please sign in to comment.