mirror of
https://github.com/elisspace/autopsy.git
synced 2026-09-28 13:30:00 +00:00
Improve escaping of keyword search results for blackboard
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user