feat: update gitea vendor
runner nix smoke / nix label and flake smoke (push) Failing after 1m28s

This commit is contained in:
2026-09-26 21:18:24 +00:00
parent c439c1b948
commit d9b2a4e787
3538 changed files with 116131 additions and 44340 deletions
+5 -4
View File
@@ -5,10 +5,11 @@ package utils
import (
"html"
"strings"
"html/template"
)
// SanitizeFlashErrorString will sanitize a flash error string
func SanitizeFlashErrorString(x string) string {
return strings.ReplaceAll(html.EscapeString(x), "\n", "<br>")
// EscapeFlashErrorString will escape the flash error string
// Maybe do more sanitization in the future, e.g.: hide sensitive information, etc.
func EscapeFlashErrorString(x string) template.HTML {
return template.HTML(html.EscapeString(x))
}
@@ -4,16 +4,17 @@
package utils
import (
"html/template"
"testing"
"github.com/stretchr/testify/assert"
)
func TestSanitizeFlashErrorString(t *testing.T) {
func TestEscapeFlashErrorString(t *testing.T) {
tests := []struct {
name string
arg string
want string
want template.HTML
}{
{
name: "no error",
@@ -28,13 +29,13 @@ func TestSanitizeFlashErrorString(t *testing.T) {
{
name: "line break error",
arg: "some error:\n\nawesome!",
want: "some error:<br><br>awesome!",
want: "some error:\n\nawesome!",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := SanitizeFlashErrorString(tt.arg)
got := EscapeFlashErrorString(tt.arg)
assert.Equal(t, tt.want, got)
})
}