Commit db93a6bd authored by Enrico Ferrari's avatar Enrico Ferrari

Fix parsing logic of XMPPDecoder used in ProtocolCodecFactory so CDATA...

Fix parsing logic of XMPPDecoder used in ProtocolCodecFactory so CDATA sections can be parsed correctly when the character data ends with a ']' character. This fixes how the XMLLightweightParser handles CDATA sections that end with ]]]>
parent e042a2e9
......@@ -311,6 +311,10 @@ class XMLLightweightParser {
status = XMLLightweightParser.OUTSIDE;
cdataOffset = 0;
}
} else if (cdataOffset == XMLLightweightParser.CDATA_END.length-1 && ch == XMLLightweightParser.CDATA_END[cdataOffset - 1]) {
// if we are looking for the last CDATA_END char, and we instead found an extra ']'
// char, leave cdataOffset as is and proceed to the next char. This could be a case
// where the XML character data ends with multiple square braces. For Example ]]]>
} else {
cdataOffset = 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment