Commit 2bd6784e authored by Dave Cridland's avatar Dave Cridland

Merge pull request #187 from Symphono/CDATA_parser_fix

Fix parsing logic of CDATA in  XMLLightweightParser
parents e042a2e9 db93a6bd
...@@ -311,6 +311,10 @@ class XMLLightweightParser { ...@@ -311,6 +311,10 @@ class XMLLightweightParser {
status = XMLLightweightParser.OUTSIDE; status = XMLLightweightParser.OUTSIDE;
cdataOffset = 0; 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 { } else {
cdataOffset = 0; 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