fix error on *abc query input

http://mantis.tokeek.de/view.php?id=486
pull/1/head
reger 10 years ago
parent 2ef8ffdb60
commit b241264632

@ -85,9 +85,12 @@ public class QueryModifier {
}
// parse 'common search mistakes' like guessed regular expressions
// (changes "abc*" to "ab", "abc *def" to "abcdef") TODO: handle most common "abc*"
int p = querystring.indexOf('*');
if ((p >= 0) && ((p > 0 && querystring.charAt(p - 1) != ' ') || (p < querystring.length() - 1 && querystring.charAt(p + 1) != ' '))) querystring = querystring.substring(0, p - 1) + querystring.substring(p + 1);
if ((p >= 0) && ((p > 0 && querystring.charAt(p - 1) != ' ') || (p > 1 && p < querystring.length() - 1 && querystring.charAt(p + 1) != ' '))) {
querystring = querystring.substring(0, p - 1) + querystring.substring(p + 1);
}
// parse filetype
querystring = filetypeParser(querystring, "filetype:");

Loading…
Cancel
Save