- added parsing of numeric html entities for crawler

- fixed a bug in search response

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4843 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent a8304ad963
commit d8277e6af1

@ -107,7 +107,7 @@ public class ysearch {
}
if (sb.facilityDB != null) try { sb.facilityDB.update("zeitgeist", querystring, post); } catch (Exception e) {}
int itemsPerPage = Math.max((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative
int itemsPerPage = Math.min((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative
int offset = post.getInt("startRecord", post.getInt("offset", 0));
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");

@ -138,7 +138,7 @@ public class yacysearch {
}
if (sb.facilityDB != null) try { sb.facilityDB.update("zeitgeist", querystring, post); } catch (Exception e) {}
int itemsPerPage = Math.max((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative
int itemsPerPage = Math.min((authenticated) ? 1000 : 10, post.getInt("maximumRecords", post.getInt("count", 10))); // SRU syntax with old property as alternative
int offset = post.getInt("startRecord", post.getInt("offset", 0));
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");

@ -411,9 +411,17 @@ public abstract class htmlFilterAbstractScraper implements htmlFilterScraper {
}
private static char[] transscript(char[] code) {
String t = (String) trans.get(new String(code));
if (t == null) return new char[0];
return t.toCharArray();
if (code[1] == '#') {
if (code[2] == 'x' || code[2] == 'X') {
return new char[] {(char) Integer.parseInt((new String(code)).substring(3, code.length - 1), 16)};
} else {
return new char[] {(char) Integer.parseInt((new String(code)).substring(2, code.length - 1))};
}
} else {
String t = (String) trans.get(new String(code));
if (t == null) return new char[0];
return t.toCharArray();
}
}
protected static serverCharBuffer transscriptAll(serverCharBuffer bb) {

Loading…
Cancel
Save