From eca171ba2e93b719d63603f8692d8938ec001ee6 Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 3 Sep 2008 14:41:20 +0000 Subject: [PATCH] fix for case where javascript was not filtered by the html parser see http://forum.yacy-websuche.de/viewtopic.php?p=9667#p9667 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5108 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/htmlFilter/htmlFilterWriter.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/de/anomic/htmlFilter/htmlFilterWriter.java b/source/de/anomic/htmlFilter/htmlFilterWriter.java index 1d09356d9..059f0c151 100644 --- a/source/de/anomic/htmlFilter/htmlFilterWriter.java +++ b/source/de/anomic/htmlFilter/htmlFilterWriter.java @@ -397,6 +397,7 @@ public final class htmlFilterWriter extends Writer { 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') && @@ -422,12 +423,12 @@ public final class htmlFilterWriter extends Writer { 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') &&