aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base/alert.tmpl
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-03-01 18:16:19 +0800
committerGitHub <noreply@github.com>2024-03-01 10:16:19 +0000
commitfb42972c057364a1dc99dfb528554e7a94415be7 (patch)
tree162d9e043c62df788f438ae2bb65983e301f8517 /templates/base/alert.tmpl
parentcb52b17f92e2d2293f7c003649743464492bca48 (diff)
downloadgitea-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 'templates/base/alert.tmpl')
-rw-r--r--templates/base/alert.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/base/alert.tmpl b/templates/base/alert.tmpl
index 160584f769..760d3bfa2c 100644
--- a/templates/base/alert.tmpl
+++ b/templates/base/alert.tmpl
@@ -1,20 +1,20 @@
{{if .Flash.ErrorMsg}}
<div class="ui negative message flash-message flash-error">
- <p>{{.Flash.ErrorMsg | Str2html}}</p>
+ <p>{{.Flash.ErrorMsg | SanitizeHTML}}</p>
</div>
{{end}}
{{if .Flash.SuccessMsg}}
<div class="ui positive message flash-message flash-success">
- <p>{{.Flash.SuccessMsg | Str2html}}</p>
+ <p>{{.Flash.SuccessMsg | SanitizeHTML}}</p>
</div>
{{end}}
{{if .Flash.InfoMsg}}
<div class="ui info message flash-message flash-info">
- <p>{{.Flash.InfoMsg | Str2html}}</p>
+ <p>{{.Flash.InfoMsg | SanitizeHTML}}</p>
</div>
{{end}}
{{if .Flash.WarningMsg}}
<div class="ui warning message flash-message flash-warning">
- <p>{{.Flash.WarningMsg | Str2html}}</p>
+ <p>{{.Flash.WarningMsg | SanitizeHTML}}</p>
</div>
{{end}}