过滤关键字
This commit is contained in:
parent
718276c410
commit
3b4e5e7833
@ -552,6 +552,9 @@ func isSafeSQL(sql string) bool {
|
||||
"CAST(", "CONVERT(", "IF(", "CASE", "WHEN", "THEN", "END",
|
||||
}
|
||||
|
||||
upperSQL = strings.ReplaceAll(upperSQL, "CREATED_AT", "")
|
||||
upperSQL = strings.ReplaceAll(upperSQL, "UPDATED_AT", "")
|
||||
|
||||
// 检查危险关键字
|
||||
for _, keyword := range dangerousKeywords {
|
||||
if strings.Contains(upperSQL, keyword) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user