123456789101112131415161718192021222324 |
- package lib
- import "strings"
- // 过滤sql特殊字符
- func ReplaceSQL(name string) string {
- name = strings.Replace(name, ";", "", -1)
- name = strings.Replace(name, ",", "", -1)
- name = strings.Replace(name, "?", "", -1)
- name = strings.Replace(name, "<", "", -1)
- name = strings.Replace(name, ">", "", -1)
- name = strings.Replace(name, "(", "", -1)
- name = strings.Replace(name, ")", "", -1)
- name = strings.Replace(name, "@", "", -1)
- name = strings.Replace(name, "=", "", -1)
- name = strings.Replace(name, "+", "", -1)
- name = strings.Replace(name, "*", "", -1)
- name = strings.Replace(name, "&", "", -1)
- name = strings.Replace(name, "#", "", -1)
- name = strings.Replace(name, "%", "", -1)
- name = strings.Replace(name, "$", "", -1)
- return name
- }
|