aboutsummaryrefslogtreecommitdiff
path: root/main.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 /main.go
parent83fccbfb4e6755662ef38d0a12fc073f38bf8bdf (diff)
fixed double post problem maybe.....
Diffstat (limited to 'main.go')
-rw-r--r--main.go13
1 files changed, 12 insertions, 1 deletions
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
+}