+ BuildWhitelistForStringSanitisation
This commit is contained in:
parent
9c4d3c851c
commit
68f6576663
12
strings.go
12
strings.go
@ -6,6 +6,18 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// BuildWhitelistForStringSanitisation transfroms a slice of whitelisted substrings into a hashtable
|
||||
func BuildWhitelistForStringSanitisation(wl []string) map[string]string {
|
||||
whitelist := map[string]string{}
|
||||
|
||||
for _, c := range wl {
|
||||
whitelist[c] = c
|
||||
}
|
||||
|
||||
return whitelist
|
||||
|
||||
}
|
||||
|
||||
// FirstCharacterToUppercase converts the first character of a string to uppercase
|
||||
func FirstCharacterToUppercase(s string) string {
|
||||
if len(s) == 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user