aboutsummaryrefslogtreecommitdiff
path: root/Database.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-15 14:47:57 -0800
committerFChannel <=>2021-01-15 14:47:57 -0800
commit08cfcaf5d4062adc37079430b83c741a1f355ae9 (patch)
tree94b9f1ef9adc7e8e69c6b4f41485efe3b35d99b5 /Database.go
parent83fccbfb4e6755662ef38d0a12fc073f38bf8bdf (diff)
fixed double post problem maybe.....
Diffstat (limited to 'Database.go')
-rw-r--r--Database.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/Database.go b/Database.go
index 6c3f711..f033a5b 100644
--- a/Database.go
+++ b/Database.go
@@ -6,6 +6,7 @@ import _ "github.com/lib/pq"
import "time"
import "os"
import "strings"
+import "regexp"
func GetActorFromDB(db *sql.DB, id string) Actor {
@@ -822,8 +823,11 @@ func DeleteCaptchaCodeDB(db *sql.DB, verify string) {
}
func EscapeString(text string) string {
+ re := regexp.MustCompile("(?i)(n)(\\s+)?(i)(\\s+)?(g)(\\s+)?(g)?(\\s+)?(e)(\\s+)?(r)(\\s+)?")
+ text = re.ReplaceAllString(text, "I love black people")
+ re = regexp.MustCompile("(?i)(n)(\\s+)?(i)(\\s+)?(g)(\\s+)?(g)(\\s+)?")
+ text = re.ReplaceAllString(text, "I love black people")
text = strings.Replace(text, "'", "''", -1)
- text = strings.Replace(text, "&", "&amp;", -1)
text = strings.Replace(text, "<", "&lt;", -1)
return text
}