bad quote handling in strings parameters
Status: Pre-Alpha
Brought to you by:
jenslukowski
If there is a tag like :
<application classe="interne.EditiqueC"
description="la classe de l'application"
path="fr.msa.agora.editique"
webtype="I"
persistante="true">
Xmen mis-interpret the ' in l'application and see it as
the closing quote instead of a normal char
and then misunderstand all the rest.
Logged In: NO
I don't remember if I've changed version but this bug
disapeared. Although another similar survives. When there's
a single quote or double quote alone in a comment, it is
interpreted as a marker for the begining of a String which
may not be the case.
Again an example is
<!-- l'application -->
<application>hello<application>
cause Xmen to misinterpret the content.
Possible cause
in org.xmen.internal.ui.text.XMLTagsRule the scanto method
as a quoteEscapes parameter which is not used in the body.
So scanTo should be
private int scanTo(ICharacterScanner scanner, String end,
boolean quoteEscapes) {
int c;
int i = 0;
boolean inSingleQuote = false;
boolean inDoubleQuote = false;
do {
c = scanner.read();
if ( quoteEscapes && c == '"' && !inSingleQuote) {
inDoubleQuote = !inDoubleQuote;
i = 0;
} else if (quoteEscapes && c == '\'' &&
!inDoubleQuote) {
inSingleQuote = !inSingleQuote;
i = 0;
} else if (!inSingleQuote && !inDoubleQuote) {
if (c == end.charAt(i)) {
i++;
} else if (i > 0) {
i = 0;
}
}
if (i >= end.length()) {
return c;
}
} while (c != -1);
return c;
}
Alex (author of this bug report)