Prevent searching for empty keywords (non ascii)

This commit is contained in:
M66B 2021-04-29 14:33:36 +02:00
parent e113b3a5d1
commit f2d2577fbf
1 changed files with 7 additions and 2 deletions

View File

@ -762,8 +762,13 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
or.add(new SubjectTerm(search)); or.add(new SubjectTerm(search));
} }
if (in_keywords && hasKeywords) if (in_keywords && hasKeywords) {
or.add(new FlagTerm(new Flags(MessageHelper.sanitizeKeyword(search)), true)); String keyword = MessageHelper.sanitizeKeyword(search);
if (TextUtils.isEmpty(keyword))
Log.w("Keyword empty=" + search);
else
or.add(new FlagTerm(new Flags(keyword), true));
}
if (in_message) if (in_message)
if (plus.size() + minus.size() + opt.size() == 0) if (plus.size() + minus.size() + opt.size() == 0)