From 5f1346d2d744cd378fb74903cdef1fbb290605dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Tikvi=C4=87?= Date: Wed, 5 Oct 2016 12:55:05 +0200 Subject: [PATCH] SQLProtect replaces fishy characters with blanks --- sql_sequrity.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql_sequrity.go diff --git a/sql_sequrity.go b/sql_sequrity.go new file mode 100644 index 0000000..b05a4d0 --- /dev/null +++ b/sql_sequrity.go @@ -0,0 +1,13 @@ +package restutility + +import ( + "strings" +) + +func SQLProtect(in string) string { + patern := "\"';&*<>=\\`:" + for _, c := range patern { + in = strings.Replace(in, string(c), "", -1) + } + return in +} -- 1.8.1.2