Skip to content

Commit

Permalink
fix for case where javascript was not filtered by the html parser
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiter committed Sep 3, 2008
1 parent 992635c commit eca171b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/de/anomic/htmlFilter/htmlFilterWriter.java
Expand Up @@ -397,6 +397,7 @@ public void write(final int c) throws IOException {
buffer.append(c);
final int bufferLength = buffer.length();
if ((c == rb) && (bufferLength > 14) &&
(buffer.charAt(bufferLength - 9) == lb) &&
(buffer.charAt(bufferLength - 8) == '/') &&
(buffer.charAt(bufferLength - 7) == 's') &&
(buffer.charAt(bufferLength - 6) == 'c') &&
Expand All @@ -422,12 +423,12 @@ public void write(final int c) throws IOException {
if (c == singlequote) inSingleQuote = true;
if (c == doublequote) inDoubleQuote = true;
// fill in tag text
if ((buffer.length() == 3) && (buffer.charAt(1) == excl) &&
if ((buffer.length() >= 3) && (buffer.charAt(1) == excl) &&
(buffer.charAt(2) == dash) && (c == dash)) {
// this is the start of a comment
inComment = true;
buffer.append(c);
} else if ((buffer.length() == 6) &&
} else if ((buffer.length() >= 6) &&
(buffer.charAt(1) == 's') &&
(buffer.charAt(2) == 'c') &&
(buffer.charAt(3) == 'r') &&
Expand Down

0 comments on commit eca171b

Please sign in to comment.