apply to h3

Fix for [#HER-1554] META http-equiv refresh content containing only a number misinterpreted as a URI - IA Webteam JIRA:
* ExtractorHTML.java
    don't use full 'content' as META refresh URL in absence of '='
This commit is contained in:
gojomo committed 2009-05-14 20:14:03 +00:00
1 parent 7480d2933b
commit b2e1fe93fd
1 file changed
+10 -7
@@ -800,13 +800,16 @@ public class ExtractorHTML extends ContentExtractor implements InitializingBean
return true;
}
} else if ("refresh".equalsIgnoreCase(httpEquiv) && content != null) {
String refreshUri = content.substring(content.indexOf("=") + 1);
try {
int max = getExtractorParameters().getMaxOutlinks();
Link.addRelativeToBase(curi, max, refreshUri,
HTMLLinkContext.META, Hop.REFER);
} catch (URIException e) {
logUriError(e, curi.getUURI(), refreshUri);
int urlIndex = content.indexOf("=") + 1;
if(urlIndex>0) {
String refreshUri = content.substring(urlIndex);
try {
int max = getExtractorParameters().getMaxOutlinks();
Link.addRelativeToBase(curi, max, refreshUri,
HTMLLinkContext.META, Hop.REFER);
} catch (URIException e) {
logUriError(e, curi.getUURI(), refreshUri);
}
}
}
return false;