From 2f34f1ec214678fb1f87fb82fb4519a366c80b66 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Tue, 15 Aug 2023 00:56:15 +0800 Subject: [PATCH] Use `object-fit: contain` for oauth2 custom icons (#26493) (#26498) Backport #26493 by @wxiaoguang It works for various sizes. Co-authored-by: wxiaoguang (cherry picked from commit 24d6aacc7ee4745799bd2f778c0e2e882099cfa3) --- services/auth/source/oauth2/providers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/auth/source/oauth2/providers.go b/services/auth/source/oauth2/providers.go index 16620fad6d..7572aa20c0 100644 --- a/services/auth/source/oauth2/providers.go +++ b/services/auth/source/oauth2/providers.go @@ -56,7 +56,7 @@ func (p *AuthSourceProvider) DisplayName() string { func (p *AuthSourceProvider) IconHTML() template.HTML { if p.iconURL != "" { - img := fmt.Sprintf(`%s`, + img := fmt.Sprintf(`%s`, html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()), ) return template.HTML(img)