diff options
Diffstat (limited to 'src/xmlreader.cpp')
-rw-r--r-- | src/xmlreader.cpp | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/xmlreader.cpp b/src/xmlreader.cpp index 76c6258..70fd1d7 100644 --- a/src/xmlreader.cpp +++ b/src/xmlreader.cpp | |||
@@ -332,8 +332,7 @@ bool XmlReader::content() | |||
332 | } | 332 | } |
333 | setContent( fbContent.getData() ); | 333 | setContent( fbContent.getData() ); |
334 | } | 334 | } |
335 | usedChar(); | 335 | usedChar( 2 ); |
336 | usedChar(); | ||
337 | gcall( ws() ); | 336 | gcall( ws() ); |
338 | FlexBuf fbName; | 337 | FlexBuf fbName; |
339 | while( true ) | 338 | while( true ) |
@@ -368,6 +367,46 @@ bool XmlReader::content() | |||
368 | throw XmlException("Malformed close tag."); | 367 | throw XmlException("Malformed close tag."); |
369 | } | 368 | } |
370 | } | 369 | } |
370 | else if( getChar(1) == '!' ) | ||
371 | { | ||
372 | // We know it's a comment, let's see if it's proper | ||
373 | if( getChar(2) != '-' || | ||
374 | getChar(3) != '-' ) | ||
375 | { | ||
376 | // Not a valid XML comment | ||
377 | throw XmlException("Malformed comment start tag found."); | ||
378 | } | ||
379 | |||
380 | usedChar( 4 ); | ||
381 | |||
382 | // Now burn text until we find the close tag | ||
383 | for(;;) | ||
384 | { | ||
385 | if( getChar() == '-' ) | ||
386 | { | ||
387 | if( getChar( 1 ) == '-' ) | ||
388 | { | ||
389 | // The next one has to be a '>' now | ||
390 | if( getChar( 2 ) != '>' ) | ||
391 | { | ||
392 | throw XmlException("Malformed comment close tag found. You cannot have a '--' that isn't followed by a '>' in a comment."); | ||
393 | } | ||
394 | usedChar( 3 ); | ||
395 | break; | ||
396 | } | ||
397 | else | ||
398 | { | ||
399 | // Found a dash followed by a non dash, that's ok... | ||
400 | usedChar( 2 ); | ||
401 | } | ||
402 | } | ||
403 | else | ||
404 | { | ||
405 | // Burn comment chars | ||
406 | usedChar(); | ||
407 | } | ||
408 | } | ||
409 | } | ||
371 | else | 410 | else |
372 | { | 411 | { |
373 | if( fbContent.getLength() > 0 ) | 412 | if( fbContent.getLength() > 0 ) |