From 188e2e147cc167ada6d3d92416d5428f8167c5c2 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 25 Jul 2024 21:11:09 -0700 Subject: [PATCH] Update search keywords --- pkg/spam/spam.go | 17 +++++++++++------ web/templates/account/search.html | 24 ++++++++++++++++++++---- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pkg/spam/spam.go b/pkg/spam/spam.go index 44b090b..e140349 100644 --- a/pkg/spam/spam.go +++ b/pkg/spam/spam.go @@ -66,8 +66,9 @@ func RestrictSearchTerms(terms *models.Search) (*models.Search, error) { // Restricted search terms. var restrictedSearchTerms = []string{ "open", "mind", "minded", "openminded", "openmind", "taboo", "tabboo", "perv", "pervy", "grew", "raised", "raise", - "children", "kid", "kids", "dad", "dads", "mom", "moms", "underage", "yng", "ynger", "family", "families", - "18", "shota", "shotacon", "loli", "lolicon", "jailbait", "incest", "limit", "limits", + "children", "child", "kid", "kids", "dad", "dads", "mom", "moms", "father", "mother", "underage", "yng", "ynger", "family", "families", + "18", "shota", "shotacon", "loli", "lolicon", "jailbait", "incest", "limit", "limits", "uninhibited", "depraved", "age", "ages", + "son", "daughter", "sons", "daughters", } func restrictTermsFrom(terms []string, blacklist map[string]interface{}) ([]string, int) { @@ -77,11 +78,15 @@ func restrictTermsFrom(terms []string, blacklist map[string]interface{}) ([]stri ) for _, term := range terms { - if _, ok := blacklist[strings.ToLower(term)]; ok { - count++ - continue + // Break words in "quoted strings" too. + words := strings.Split(term, " ") + for _, word := range words { + if _, ok := blacklist[strings.ToLower(word)]; ok { + count++ + continue + } + result = append(result, word) } - result = append(result, term) } return result, count diff --git a/web/templates/account/search.html b/web/templates/account/search.html index bbd5bea..c066c09 100644 --- a/web/templates/account/search.html +++ b/web/templates/account/search.html @@ -73,10 +73,26 @@ {{if .RestrictedSearchError}}

- - Notice: Some of your search terms will be ignored, as we think - they may be associated to child sexual abuse. - Please review the Terms of Service for more information. + + Child sexual abuse is illegal +

+ +

+ We think that your search might be associated with child sexual abuse. Child sexual abuse or seeking + sexual imagery or contact with children can lead to imprisonment and other severe personal consequences, + and this abuse causes extreme harm to children and searching and viewing such material adds to that harm. +

+ +

+ It is also against the Terms of Service of this website, and + members who violate this rule will be banned. This website is actively monitored to keep on top of this stuff, + and we cooperate enthusiastically with + NCMEC + and relevant law enforcement agencies. +

+ +

+ This incident has been reported to the website administrator.

{{end}}