diff options
author | FChannel <=> | 2021-01-15 14:47:57 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-15 14:47:57 -0800 |
commit | 08cfcaf5d4062adc37079430b83c741a1f355ae9 (patch) | |
tree | 94b9f1ef9adc7e8e69c6b4f41485efe3b35d99b5 /main.go | |
parent | 83fccbfb4e6755662ef38d0a12fc073f38bf8bdf (diff) |
fixed double post problem maybe.....
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 +} |