Blame view

sql_sequrity.go 205 Bytes
ea858b8a7   Marko Tikvić   refactoring
1
  package webutility
5f1346d2d   Marko Tikvić   SQLProtect replac...
2
3
4
5
  
  import (
  	"strings"
  )
ea858b8a7   Marko Tikvić   refactoring
6
7
8
  var patern string = "\"';&*<>=\\`:"
  
  func SQLSafeString(s string) string {
5f1346d2d   Marko Tikvić   SQLProtect replac...
9
  	for _, c := range patern {
ea858b8a7   Marko Tikvić   refactoring
10
  		s = strings.Replace(s, string(c), "", -1)
5f1346d2d   Marko Tikvić   SQLProtect replac...
11
  	}
ea858b8a7   Marko Tikvić   refactoring
12
  	return s
5f1346d2d   Marko Tikvić   SQLProtect replac...
13
  }