From 4bf669147fff02f984acc5e327bbc0e1f0dc0f06 Mon Sep 17 00:00:00 2001 From: adam-m Date: Fri, 16 Mar 2012 09:43:44 -0400 Subject: [PATCH] Improve escaping of keyword search results for blackboard --- .../autopsy/keywordsearch/KeywordSearchUtil.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchUtil.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchUtil.java index 60b0acc278..a9f8a4744e 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchUtil.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchUtil.java @@ -127,16 +127,12 @@ public class KeywordSearchUtil { return false; } } - + //TODO escaping should be handled by blackboard public static String escapeForBlackBoard(String text) { try { - text = text.replaceAll("\\\\", URLEncoder.encode("\\", "UTF-8")); - text = text.replaceAll("'", URLEncoder.encode("'", "UTF-8")); - text = text.replaceAll("=", URLEncoder.encode("=", "UTF-8")); - text = text.replaceAll("\\?", URLEncoder.encode("?", "UTF-8")); - text = text.replaceAll(">", URLEncoder.encode(">", "UTF-8")); - text = text.replaceAll("<", URLEncoder.encode("<", "UTF-8")); + text = text.replaceAll("\\\\'", URLEncoder.encode("\\'", "UTF-8")); + //text = text.replaceAll("\\\\", URLEncoder.encode("\\", "UTF-8")); } catch (UnsupportedEncodingException ex) { } return text;