mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Compare commits
2 commits
a8de515e9c
...
6ca24cab77
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6ca24cab77 | ||
![]() |
0035475214 |
2 changed files with 2 additions and 11 deletions
|
@ -2,6 +2,7 @@ package router
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"html"
|
||||||
"io"
|
"io"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
@ -115,7 +116,7 @@ func New(tmplDir fs.FS, extraData map[string]interface{}, secret [64]byte) *echo
|
||||||
//"htmlescaper": template.htmlEscaper,
|
//"htmlescaper": template.htmlEscaper,
|
||||||
funcs := template.FuncMap{
|
funcs := template.FuncMap{
|
||||||
"StringsJoin": strings.Join,
|
"StringsJoin": strings.Join,
|
||||||
"attrescaper": util.EscapeHtmlCode,
|
"attrescaper": html.EscapeString,
|
||||||
}
|
}
|
||||||
templates := make(map[string]*template.Template)
|
templates := make(map[string]*template.Template)
|
||||||
templates["login.html"] = template.Must(template.New("login").Funcs(funcs).Parse(tmplLoginString))
|
templates["login.html"] = template.Must(template.New("login").Funcs(funcs).Parse(tmplLoginString))
|
||||||
|
|
10
util/html.go
10
util/html.go
|
@ -1,10 +0,0 @@
|
||||||
package util
|
|
||||||
|
|
||||||
import (
|
|
||||||
"html"
|
|
||||||
)
|
|
||||||
|
|
||||||
func EscapeHtmlCode(s string) string {
|
|
||||||
encodedString := html.EscapeString(s)
|
|
||||||
return encodedString
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue