sql_sequrity.go
310 Bytes
package webutility
import (
"strings"
)
var patern string = "\"';&*<>=\\`:"
// SQLSafeString removes characters from s found in patern and returns new modified string.
func SQLSafeString(s string) (safe string) {
for _, c := range patern {
safe = strings.Replace(s, string(c), "", -1)
}
return safe
}