Improve escaping of keyword search results for blackboard

This commit is contained in:
adam-m
2012-03-16 09:43:44 -04:00
parent 3a5acae59d
commit 4bf669147f
@@ -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;