mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix: 修复 XmlEscape 未对单引号进行转义的问题
This commit is contained in:
parent
307670b50d
commit
f4cf4dc21f
@ -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
|
||||
{"<", "<"}, // < - less-than
|
||||
|
@ -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[]{"'", "'"}};
|
||||
|
||||
/**
|
||||
* 构造
|
||||
@ -22,6 +20,5 @@ public class XmlUnescape extends ReplacerChain {
|
||||
public XmlUnescape() {
|
||||
addChain(new LookupReplacer(BASIC_UNESCAPE));
|
||||
addChain(new NumericEntityUnescaper());
|
||||
addChain(new LookupReplacer(OTHER_UNESCAPE));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user