From 1e8b64ac581cdc14d250c299347a628a5b57813b Mon Sep 17 00:00:00 2001 From: "Niels Erik G. Nielsen" Date: Fri, 18 Apr 2014 15:53:05 -0400 Subject: [PATCH] Adds pazpar2 limit parameter delimiters to escape --- .../indexdata/mkjsf/pazpar2/commands/LimitParameter.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java index 93a26fc..9a11143 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java @@ -31,17 +31,14 @@ public class LimitParameter extends CommandParameter { completeValue.append(","); else first=false; - completeValue.append(expr.toString()); + completeValue.append(expr.getField() + expr.getOperator() + expr.getValue()); logger.trace("valueWithExpressions so far: [" + completeValue + "]"); } return completeValue.toString(); } - - private String pz2escape (String expressionString) { - String escaped = expressionString.replaceAll("\\\\","\\\\\\\\"); - escaped = escaped.replaceAll(",","\\\\,"); - escaped = escaped.replaceAll("\\|", "\\\\|"); - return escaped; + + private String pz2escape (String str) { + return str.replaceAll("[~|,=\\\\]","\\\\$0"); } -- 1.7.10.4