]> source.dussan.org Git - gitblit.git/commitdiff
Prevent Lucene queries from starting with a conjunction
authorJames Moger <james.moger@gitblit.com>
Sat, 8 Mar 2014 16:59:18 +0000 (11:59 -0500)
committerJames Moger <james.moger@gitblit.com>
Sat, 8 Mar 2014 16:59:43 +0000 (11:59 -0500)
src/main/java/com/gitblit/tickets/QueryBuilder.java

index 17aeb988da191593159229d2ad8d18e51515495b..0a6d0e99fd08ab14a81595fd5b8cddaa8a262972 100644 (file)
@@ -201,6 +201,12 @@ public class QueryBuilder {
                                q = q.substring(1, q.length() - 1);
                        }
                }
+               if (q.startsWith("AND ")) {
+                       q = q.substring(3).trim();
+               }
+               if (q.startsWith("OR ")) {
+                       q = q.substring(2).trim();
+               }
                return q;
        }