diff --git a/htroot/gsa/searchresult.java b/htroot/gsa/searchresult.java index 779742658..f8312f007 100644 --- a/htroot/gsa/searchresult.java +++ b/htroot/gsa/searchresult.java @@ -144,13 +144,13 @@ public class searchresult { } else { post.put(CommonParams.SORT, sorts); } - String site = post.remove("site"); // example: col1|col2 - String access = post.remove("access"); - String entqr = post.remove("entqr"); + String[] site = post.remove("site"); // example: col1|col2 + String[] access = post.remove("access"); + String[] entqr = post.remove("entqr"); // add sites operator - if (site != null && site.length() > 0) { - String[] s0 = CommonPattern.VERTICALBAR.split(site); + if (site != null && site[0].length() > 0) { + String[] s0 = CommonPattern.VERTICALBAR.split(site[0]); ArrayList sites = new ArrayList(2); for (String s: s0) { s = s.trim().toLowerCase(); @@ -189,8 +189,8 @@ public class searchresult { context.put("client", "vsm_frontent"); context.put("sort", sort.sort); context.put("site", site == null ? "" : site); - context.put("access", access == null ? "p" : access); - context.put("entqr", entqr == null ? "3" : entqr); + context.put("access", access == null ? "p" : access[0]); + context.put("entqr", entqr == null ? "3" : entqr[0]); // write the result directly to the output stream Writer ow = new FastWriter(new OutputStreamWriter(out, UTF8.charset)); diff --git a/source/net/yacy/data/WorkTables.java b/source/net/yacy/data/WorkTables.java index d7bf82424..5a68b1008 100644 --- a/source/net/yacy/data/WorkTables.java +++ b/source/net/yacy/data/WorkTables.java @@ -104,8 +104,8 @@ public class WorkTables extends Tables { */ public byte[] recordAPICall(final serverObjects post, final String servletName, final String type, final String comment) { // remove the apicall attributes from the post object - String pks = post.remove(TABLE_API_COL_APICALL_PK); - byte[] pk = pks == null ? null : UTF8.getBytes(pks); + String[] pks = post.remove(TABLE_API_COL_APICALL_PK); + byte[] pk = pks == null ? null : UTF8.getBytes(pks[0]); // generate the apicall url - without the apicall attributes final String apiurl = /*"http://localhost:" + getConfig("port", "8090") +*/ "/" + servletName + "?" + post.toString(); diff --git a/source/net/yacy/server/http/HTTPDFileHandler.java b/source/net/yacy/server/http/HTTPDFileHandler.java index dec2959d9..50ab3d2c2 100644 --- a/source/net/yacy/server/http/HTTPDFileHandler.java +++ b/source/net/yacy/server/http/HTTPDFileHandler.java @@ -366,7 +366,7 @@ public final class HTTPDFileHandler { serverCore.bfHost.remove(conProp.get(HeaderFramework.CONNECTION_PROP_CLIENTIP)); // parse arguments - serverObjects args = new serverObjects(); + serverObjects args = new serverObjects(true); int argc = 0; if (argsString == null) { // no args here, maybe a POST with multipart extension diff --git a/source/net/yacy/server/http/HTTPDemon.java b/source/net/yacy/server/http/HTTPDemon.java index 8c6dc8e40..ee6309338 100644 --- a/source/net/yacy/server/http/HTTPDemon.java +++ b/source/net/yacy/server/http/HTTPDemon.java @@ -329,7 +329,7 @@ public final class HTTPDemon implements serverHandler, Cloneable { if (returncode == UserDB.Entry.PROXY_ALLOK) { return true; } - final serverObjects tp = new serverObjects(); + final serverObjects tp = new serverObjects(true); if (returncode == UserDB.Entry.PROXY_TIMELIMIT_REACHED) { tp.put("limit", "1");//time per day tp.put("limit_timelimit", entry.getTimeLimit()); @@ -1075,7 +1075,7 @@ public final class HTTPDemon implements serverHandler, Cloneable { } // set rewrite values - final serverObjects tp = new serverObjects(); + final serverObjects tp = new serverObjects(true); String clientIP = (String) conProp.get(HeaderFramework.CONNECTION_PROP_CLIENTIP); if (clientIP == null) clientIP = Domains.LOCALHOST; diff --git a/source/net/yacy/server/http/TemplateEngine.java b/source/net/yacy/server/http/TemplateEngine.java index c7888e56f..9cd9d7293 100644 --- a/source/net/yacy/server/http/TemplateEngine.java +++ b/source/net/yacy/server/http/TemplateEngine.java @@ -55,14 +55,13 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PushbackInputStream; -import java.util.HashMap; -import java.util.Map; import net.yacy.cora.document.ASCII; import net.yacy.cora.document.UTF8; import net.yacy.kelondro.logging.Log; import net.yacy.kelondro.util.ByteBuffer; import net.yacy.kelondro.util.FileUtils; +import net.yacy.server.serverObjects; /** @@ -193,7 +192,7 @@ public final class TemplateEngine { return false; } - public final static void writeTemplate(final InputStream in, final OutputStream out, final Map pattern, final byte[] dflt) throws IOException { + public final static void writeTemplate(final InputStream in, final OutputStream out, final serverObjects pattern, final byte[] dflt) throws IOException { if (pattern == null) { FileUtils.copy(in, out); } else { @@ -204,7 +203,7 @@ public final class TemplateEngine { /** * Reads a input stream, and writes the data with replaced templates on a output stream */ - private final static byte[] writeTemplate(final InputStream in, final OutputStream out, final Map pattern, final byte[] dflt, final byte[] prefix) throws IOException { + private final static byte[] writeTemplate(final InputStream in, final OutputStream out, final serverObjects pattern, final byte[] dflt, final byte[] prefix) throws IOException { final PushbackInputStream pis = new PushbackInputStream(in, 100); final ByteArrayOutputStream keyStream = new ByteArrayOutputStream(4048); byte[] key; @@ -437,7 +436,7 @@ public final class TemplateEngine { return sb; } - private final static byte[] replacePattern(final String key, final Map pattern, final byte dflt[]) { + private final static byte[] replacePattern(final String key, final serverObjects pattern, final byte dflt[]) { byte[] replacement; Object value; if (pattern.containsKey(key)) { @@ -512,7 +511,7 @@ public final class TemplateEngine { // arg1 = test input; arg2 = replacement for pattern 'test'; arg3 = default replacement try { final InputStream i = new ByteArrayInputStream(UTF8.getBytes(args[0])); - final Map h = new HashMap(); + final serverObjects h = new serverObjects(true); h.put("test", args[1]); writeTemplate(new PushbackInputStream(i, 100), System.out, h, UTF8.getBytes(args[2])); System.out.flush();