fix(login): (re)allow HTML in custom login texts (#7575)

fix: allow HTML in custom login texts
This commit is contained in:
Livio Spring 2024-03-15 16:29:10 +01:00 committed by GitHub
parent 732217bc5e
commit 6c3f48f496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -123,7 +123,7 @@ func (r *Renderer) registerTranslateFn(req *http.Request, translator *i18n.Trans
if translator == nil {
return funcs
}
funcs[TranslateFn] = func(id string, args ...interface{}) string {
funcs[TranslateFn] = func(id string, args ...interface{}) template.HTML {
m := map[string]interface{}{}
var key string
for i, arg := range args {
@ -134,9 +134,9 @@ func (r *Renderer) registerTranslateFn(req *http.Request, translator *i18n.Trans
m[key] = arg
}
if r == nil {
return r.Localize(translator, id, m)
return template.HTML(r.Localize(translator, id, m))
}
return r.LocalizeFromRequest(translator, req, id, m)
return template.HTML(r.LocalizeFromRequest(translator, req, id, m))
}
return funcs
}