Skip to content

Commit

Permalink
Reject search term with empty value.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertabcd committed Apr 24, 2018
1 parent b068666 commit d0ce266
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pttweb.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ func parseKeyValueTerm(term string) (pttbbs.SearchPredicate, bool) {
return nil, false
}
k, v := strings.ToLower(kv[0]), kv[1]
if len(v) == 0 {
return nil, false
}
switch k {
case "author":
return pttbbs.WithAuthor(v), true
Expand Down

0 comments on commit d0ce266

Please sign in to comment.