diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-04 15:16:02 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-04 15:16:02 -0400 |
commit | a4fa1b996be8641aa5c89375ee78cc6eb70a7c76 (patch) | |
tree | 5177df0fdc721802a959c1fff52ac82060cb43f7 /src | |
parent | 4a17b9332b01bfe37e6bceac18738f9e536f7023 (diff) | |
download | gitblit-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.java | 6 |
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; |