Check for empty tag stack, fixing bug 414

http://helma.org/bugs/show_bug.cgi?id=414
This commit is contained in:
hns 2005-03-01 12:15:51 +00:00
parent 05753dc7e5
commit 21d0cffb54

View file

@ -714,7 +714,8 @@ public final class HtmlEncoder {
if (str.charAt(i - 1) == '/') {
// this is to avoid misinterpreting tags like
// <a href=http://foo/> as empty
if (htmlTagMode != TAG_ATT_VAL && htmlTagMode != TAG_ATT_NAME) {
if (!openTags.empty() && htmlTagMode != TAG_ATT_VAL &&
htmlTagMode != TAG_ATT_NAME) {
openTags.pop();
}
}