Don't escape the name when doing the exact matching for tag (#13533)

Don't escape the name when doing the exact matching for tag
Fixes #13106

Signed-off-by: Wenkai Yin <yinw@vmware.com>
This commit is contained in:
Wenkai Yin(尹文开) 2020-11-18 14:34:48 +08:00 committed by GitHub
parent eca3de3489
commit def782b6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,7 +335,7 @@ func setTagQuery(qs beegoorm.QuerySeter, query *q.Query) (beegoorm.QuerySeter, e
sql := fmt.Sprintf(`IN (
SELECT DISTINCT art.id FROM artifact art
JOIN tag ON art.id=tag.artifact_id
WHERE tag.name = '%s')`, orm.Escape(s))
WHERE tag.name = '%s')`, s)
qs = qs.FilterRaw("id", sql)
return qs, nil
}