From: <bra...@us...> - 2008-07-15 01:19:52
|
Revision: 2444 http://archive-access.svn.sourceforge.net/archive-access/?rev=2444&view=rev Author: bradtofel Date: 2008-07-14 18:20:01 -0700 (Mon, 14 Jul 2008) Log Message: ----------- BUGFIX(ACC-26): string OOB exception in javascript generated escaped HTML attributes. Modified Paths: -------------- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TagMagix.java Modified: trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TagMagix.java =================================================================== --- trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TagMagix.java 2008-07-15 01:18:56 UTC (rev 2443) +++ trunk/archive-access/projects/wayback/wayback-core/src/main/java/org/archive/wayback/replay/TagMagix.java 2008-07-15 01:20:01 UTC (rev 2444) @@ -42,9 +42,9 @@ */ public class TagMagix { - // minimum length XXXX in a 'style=XXXX' declaration... mostly handy - // to keep us from trying to mark up javascript generated style code. - private static int MIN_STYLE_LENGTH = 3; + // minimum length XXXX in a 'ATTR=XXXX' declaration... mostly handy + // to keep us from trying to mark up javascript generated HTML/CSS code. + private static int MIN_ATTR_LENGTH = 3; private static HashMap<String, Pattern> pcPatterns = new HashMap<String, Pattern>(); @@ -171,7 +171,7 @@ int attrStart = matcher.start(1); int attrEnd = matcher.end(1); idx = attrEnd; - if(origAttrLength < MIN_STYLE_LENGTH) { + if(origAttrLength < MIN_ATTR_LENGTH) { continue; } @@ -250,6 +250,10 @@ int origUrlLength = url.length(); int attrStart = matcher.start(1); int attrEnd = matcher.end(1); + if(origUrlLength < MIN_ATTR_LENGTH) { + idx = attrEnd; + continue; + } String quote = ""; if (url.charAt(0) == '"') { quote = "\""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |