Update search keywords

This commit is contained in:
Noah Petherbridge 2024-07-25 21:11:09 -07:00
parent f3925c1095
commit 188e2e147c
2 changed files with 31 additions and 10 deletions

View File

@ -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

View File

@ -73,10 +73,26 @@
{{if .RestrictedSearchError}}
<div class="notification is-danger is-light content">
<p>
<i class="fa fa-exclamation-triangle mr-1"></i>
<strong>Notice:</strong> Some of your search terms will be ignored, as we think
they may be associated to child sexual abuse.
Please review the <a href="/tos#child-exploitation">Terms of Service</a> for more information.
<i class="fa fa-hand mr-1"></i>
<strong>Child sexual abuse is illegal</strong>
</p>
<p>
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.
</p>
<p>
It is also against the <a href="/tos#child-exploitation">Terms of Service</a> 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
<a href="https://www.missingkids.org/" title="National Center for Missing and Exploited Children">NCMEC</a>
and relevant law enforcement agencies.
</p>
<p>
<strong>This incident has been reported to the website administrator.</strong>
</p>
</div>
{{end}}