From d2cd213cd0090a5a8d9bc362728b0ffd9ee834a7 Mon Sep 17 00:00:00 2001 From: "U-BASIS\\dgrove" Date: Thu, 30 Mar 2017 13:02:32 -0400 Subject: [PATCH] Modified regex filter so it's in line with Solr 6 core name rules. --- .../org/sleuthkit/autopsy/keywordsearch/Index.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Index.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Index.java index 4eb443c318..16b262b801 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Index.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Index.java @@ -86,15 +86,10 @@ final class Index { static private String sanitizeCoreName(String coreName) { String result; - - // Remove all non-ASCII characters - result = coreName.replaceAll("[^\\p{ASCII}]", "_"); //NON-NLS - - // Remove all control characters - result = result.replaceAll("[\\p{Cntrl}]", "_"); //NON-NLS - - // Remove spaces / \ : ? ' " - result = result.replaceAll("[ /?:'\"\\\\]", "_"); //NON-NLS + + // Allow these characters: '-', '.', '0'-'9', 'A'-'Z', '_', and 'a'-'z'. + // Replace all else with '_'. + result = coreName.replaceAll("[^-.0-9A-Z_a-z]", "_"); // NON-NLS // Make it all lowercase result = result.toLowerCase();