mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 10:37:59 +01:00
Re-escape XML text in parseContentDepth()
SMACK-680.
This commit is contained in:
parent
a9741a8b10
commit
e6a403fb1c
1 changed files with 7 additions and 2 deletions
|
@ -481,7 +481,7 @@ public class PacketParserUtils {
|
|||
}
|
||||
break;
|
||||
case XmlPullParser.TEXT:
|
||||
xml.append(parser.getText());
|
||||
xml.escape(parser.getText());
|
||||
break;
|
||||
}
|
||||
event = parser.next();
|
||||
|
@ -497,7 +497,12 @@ public class PacketParserUtils {
|
|||
// Only append the text if the parser is not on on an empty element' start tag. Empty elements are reported
|
||||
// twice, so in order to prevent duplication we only add their text when we are on their end tag.
|
||||
if (!(event == XmlPullParser.START_TAG && parser.isEmptyElementTag())) {
|
||||
sb.append(parser.getText());
|
||||
CharSequence text = parser.getText();
|
||||
if (event == XmlPullParser.TEXT) {
|
||||
// TODO the toString() can be removed in Smack 4.2.
|
||||
text = StringUtils.escapeForXML(text.toString());
|
||||
}
|
||||
sb.append(text);
|
||||
}
|
||||
if (event == XmlPullParser.END_TAG && parser.getDepth() <= depth) {
|
||||
break outerloop;
|
||||
|
|
Loading…
Reference in a new issue