diff options
author | James Moger <james.moger@gitblit.com> | 2014-09-04 13:25:43 -0600 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-09-04 13:25:43 -0600 |
commit | a83841169a6a2f369dd57f875cd778c70cb81714 (patch) | |
tree | 5177df0fdc721802a959c1fff52ac82060cb43f7 /src | |
parent | 4a17b9332b01bfe37e6bceac18738f9e536f7023 (diff) | |
parent | a4fa1b996be8641aa5c89375ee78cc6eb70a7c76 (diff) | |
download | gitblit-a83841169a6a2f369dd57f875cd778c70cb81714.tar.gz gitblit-a83841169a6a2f369dd57f875cd778c70cb81714.zip |
Merged #153 "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; |