fix: 修复 XmlEscape 未对单引号进行转义的问题

This commit is contained in:
Zhenheng.Xie 2025-01-09 17:12:51 +08:00
parent 307670b50d
commit f4cf4dc21f
2 changed files with 1 additions and 4 deletions

View File

@ -22,7 +22,7 @@ public class XmlEscape extends ReplacerChain {
private static final long serialVersionUID = 1L;
protected static final String[][] BASIC_ESCAPE = { //
// {"'", "'"}, // " - single-quote
{"'", "'"}, // " - single-quote
{"\"", """}, // " - double-quote
{"&", "&"}, // & - ampersand
{"<", "&lt;"}, // < - less-than

View File

@ -13,8 +13,6 @@ public class XmlUnescape extends ReplacerChain {
private static final long serialVersionUID = 1L;
protected static final String[][] BASIC_UNESCAPE = InternalEscapeUtil.invert(XmlEscape.BASIC_ESCAPE);
// issue#1118
protected static final String[][] OTHER_UNESCAPE = new String[][]{new String[]{"&apos;", "'"}};
/**
* 构造
@ -22,6 +20,5 @@ public class XmlUnescape extends ReplacerChain {
public XmlUnescape() {
addChain(new LookupReplacer(BASIC_UNESCAPE));
addChain(new NumericEntityUnescaper());
addChain(new LookupReplacer(OTHER_UNESCAPE));
}
}