From 08cfcaf5d4062adc37079430b83c741a1f355ae9 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Fri, 15 Jan 2021 14:47:57 -0800 Subject: fixed double post problem maybe..... --- main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 3e67f36..cda1f97 100644 --- a/main.go +++ b/main.go @@ -583,7 +583,9 @@ func ParseCommentForReplies(comment string) []ObjectBase { str = strings.Replace(str, "http://", "", 1) str = strings.Replace(str, "https://", "", 1) str = TP + "" + str - links = append(links, str) + if !IsInStringArray(links, str) { + links = append(links, str) + } } var validLinks []ObjectBase @@ -998,3 +1000,12 @@ func PrintAdminAuth(db *sql.DB){ fmt.Println("Admin Login: " + identifier + ", Code: " + code) } + +func IsInStringArray(array []string, value string) bool { + for _, e := range array { + if e == value { + return true + } + } + return false +} -- cgit v1.2.3