mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 00:20:25 +08:00 
			
		
		
		
	Escape reference to user table in models.SearchEmails (#16313)
				
					
				
			Fix #16312 Signed-off-by: Adyanth H <adyanthh@gmail.com>
This commit is contained in:
		@@ -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(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user