aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
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
+}