mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
Add noreferrer to rel='noopener` for <a> tags (#4328)
This commit is contained in:
1 parent
4b654ad17f
commit
51ba3df5ff
17 files changed
+59
-59
No files matched your search
+1
-1
@@ -781,7 +781,7 @@ var (
|
||||
// DescriptionHTML does special handles to description and return HTML string.
|
||||
func (repo *Repository) DescriptionHTML() template.HTML {
|
||||
sanitize := func(s string) string {
|
||||
return fmt.Sprintf(`<a href="%[1]s" target="_blank" rel="noopener">%[1]s</a>`, s)
|
||||
return fmt.Sprintf(`<a href="%[1]s" target="_blank" rel="noopener noreferrer">%[1]s</a>`, s)
|
||||
}
|
||||
return template.HTML(descPattern.ReplaceAllStringFunc(markup.Sanitize(repo.Description), sanitize))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user