diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-01 18:16:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-01 10:16:19 +0000 |
commit | fb42972c057364a1dc99dfb528554e7a94415be7 (patch) | |
tree | 162d9e043c62df788f438ae2bb65983e301f8517 /routers/web/org/projects.go | |
parent | cb52b17f92e2d2293f7c003649743464492bca48 (diff) | |
download | gitea-fb42972c057364a1dc99dfb528554e7a94415be7.tar.gz gitea-fb42972c057364a1dc99dfb528554e7a94415be7.zip |
Rename Str2html to SanitizeHTML and clarify its behavior (#29516)
Str2html was abused a lot. So use a proper name for it: SanitizeHTML
And add some tests to show its behavior.
Diffstat (limited to 'routers/web/org/projects.go')
-rw-r--r-- | routers/web/org/projects.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/org/projects.go b/routers/web/org/projects.go index f2db4a4579..82cd91997a 100644 --- a/routers/web/org/projects.go +++ b/routers/web/org/projects.go @@ -105,7 +105,7 @@ func Projects(ctx *context.Context) { } for _, project := range projects { - project.RenderedContent = templates.Str2html(project.Description) // FIXME: is it right? why not render? + project.RenderedContent = templates.SanitizeHTML(project.Description) // FIXME: is it right? why not render? } err = shared_user.LoadHeaderCount(ctx) @@ -396,7 +396,7 @@ func ViewProject(ctx *context.Context) { } } - project.RenderedContent = templates.Str2html(project.Description) // FIXME: is it right? why not render? + project.RenderedContent = templates.SanitizeHTML(project.Description) // FIXME: is it right? why not render? ctx.Data["LinkedPRs"] = linkedPrsMap ctx.Data["PageIsViewProjects"] = true ctx.Data["CanWriteProjects"] = canWriteProjects(ctx) |