Browse Source

Merged #153 "Quote all Lucene query args that have non-alphanumeric characters"

tags/v1.6.1
James Moger 9 years ago
parent
commit
a83841169a
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/main/java/com/gitblit/tickets/TicketIndexer.java

+ 4
- 2
src/main/java/com/gitblit/tickets/TicketIndexer.java View File

@@ -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;

Loading…
Cancel
Save