summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-09-04 15:16:02 -0400
committerJames Moger <james.moger@gitblit.com>2014-09-04 15:16:02 -0400
commita4fa1b996be8641aa5c89375ee78cc6eb70a7c76 (patch)
tree5177df0fdc721802a959c1fff52ac82060cb43f7 /src
parent4a17b9332b01bfe37e6bceac18738f9e536f7023 (diff)
downloadgitblit-a4fa1b996be8641aa5c89375ee78cc6eb70a7c76.tar.gz
gitblit-a4fa1b996be8641aa5c89375ee78cc6eb70a7c76.zip
Quote all Lucene query args that have non-alphanumeric characters
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/tickets/TicketIndexer.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/gitblit/tickets/TicketIndexer.java b/src/main/java/com/gitblit/tickets/TicketIndexer.java
index 98fe6977..11ea3a73 100644
--- a/src/main/java/com/gitblit/tickets/TicketIndexer.java
+++ b/src/main/java/com/gitblit/tickets/TicketIndexer.java
@@ -143,8 +143,10 @@ public class TicketIndexer {
private String escape(String value) {
if (value.charAt(0) != '"') {
- if (value.indexOf('/') > -1 || value.indexOf('-') > -1) {
- return "\"" + value + "\"";
+ for (char c : value.toCharArray()) {
+ if (!Character.isLetterOrDigit(c)) {
+ return "\"" + value + "\"";
+ }
}
}
return value;