summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorAdyanth H <33192449+adyanth@users.noreply.github.com>2021-06-30 22:07:20 +0530
committerGitHub <noreply@github.com>2021-06-30 18:37:20 +0200
commit66bf74d1b924a91c279d3c68cb01d038300b551a (patch)
tree62c621e000e6da7fdb0a8743854e79c72624195f /models
parent09663493543a2ce15fc90fbb3808dda5b87335e5 (diff)
downloadgitea-66bf74d1b924a91c279d3c68cb01d038300b551a.tar.gz
gitea-66bf74d1b924a91c279d3c68cb01d038300b551a.zip
Escape reference to `user` table in models.SearchEmails (#16313)
Fix #16312 Signed-off-by: Adyanth H <adyanthh@gmail.com>
Diffstat (limited to 'models')
-rw-r--r--models/user_mail.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/user_mail.go b/models/user_mail.go
index 2758dfb8e8..320f2cb05a 100644
--- a/models/user_mail.go
+++ b/models/user_mail.go
@@ -316,7 +316,7 @@ type SearchEmailResult struct {
// SearchEmails takes options i.e. keyword and part of email name to search,
// it returns results in given range and number of total results.
func SearchEmails(opts *SearchEmailOptions) ([]*SearchEmailResult, int64, error) {
- var cond builder.Cond = builder.Eq{"user.`type`": UserTypeIndividual}
+ var cond builder.Cond = builder.Eq{"`user`.`type`": UserTypeIndividual}
if len(opts.Keyword) > 0 {
likeStr := "%" + strings.ToLower(opts.Keyword) + "%"
cond = cond.And(builder.Or(