summaryrefslogtreecommitdiffstats
path: root/routers/utils/utils.go
blob: 3035073d5c5abc5bafad3918be71022d547fb29d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright 2017 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package utils

import (
	"html"
	"strings"
)

// SanitizeFlashErrorString will sanitize a flash error string
func SanitizeFlashErrorString(x string) string {
	return strings.ReplaceAll(html.EscapeString(x), "\n", "<br>")
}