From dc35c7b12684bb9036c89552d56a3e659001101c Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 20 Jan 2020 17:12:23 -0500 Subject: [PATCH] Updating slur filter. --- server/src/lib.rs | 4 ++-- ui/src/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/lib.rs b/server/src/lib.rs index e23ec4ba1..4f5554fa2 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -136,7 +136,7 @@ mod tests { #[test] fn test_slur_filter() { let test = - "coons test dindu ladyboy tranny retardeds. Capitalized Nigger. This is a bunch of other safe text.".to_string(); + "coons test dindu ladyboy tranny retardeds. Capitalized Niggerz. This is a bunch of other safe text.".to_string(); let slur_free = "No slurs here"; assert_eq!( remove_slurs(&test), @@ -163,6 +163,6 @@ mod tests { lazy_static! { static ref EMAIL_REGEX: Regex = Regex::new(r"^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$").unwrap(); - static ref SLUR_REGEX: Regex = RegexBuilder::new(r"(fag(g|got|tard)?|maricos?|cock\s?sucker(s|ing)?|nig(\b|g?(a|er)?s?)\b|dindu(s?)|mudslime?s?|kikes?|mongoloids?|towel\s*heads?|\bspi(c|k)s?\b|\bchinks?|niglets?|beaners?|\bnips?\b|\bcoons?\b|jungle\s*bunn(y|ies?)|jigg?aboo?s?|\bpakis?\b|rag\s*heads?|gooks?|cunts?|bitch(es|ing|y)?|puss(y|ies?)|twats?|feminazis?|whor(es?|ing)|\bslut(s|t?y)?|\btrann?(y|ies?)|ladyboy(s?)|\b(b|re|r)tard(ed)?s?)").case_insensitive(true).build().unwrap(); + static ref SLUR_REGEX: Regex = RegexBuilder::new(r"(fag(g|got|tard)?|maricos?|cock\s?sucker(s|ing)?|nig(\b|g?(a|er)?(s|z)?)\b|dindu(s?)|mudslime?s?|kikes?|mongoloids?|towel\s*heads?|\bspi(c|k)s?\b|\bchinks?|niglets?|beaners?|\bnips?\b|\bcoons?\b|jungle\s*bunn(y|ies?)|jigg?aboo?s?|\bpakis?\b|rag\s*heads?|gooks?|cunts?|bitch(es|ing|y)?|puss(y|ies?)|twats?|feminazis?|whor(es?|ing)|\bslut(s|t?y)?|\btrann?(y|ies?)|ladyboy(s?)|\b(b|re|r)tard(ed)?s?)").case_insensitive(true).build().unwrap(); static ref USERNAME_MATCHES_REGEX: Regex = Regex::new(r"/u/[a-zA-Z][0-9a-zA-Z_]*").unwrap(); } diff --git a/ui/src/utils.ts b/ui/src/utils.ts index dc2217165..a90afbd8b 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -201,7 +201,7 @@ export function debounce( // 'private' variable for instance // The returned function will be able to reference this due to closure. // Each call to the returned function will share this common timer. - let timeout: number; + let timeout: any; // Calling debounce returns a new anonymous function return function() {