]> Untitled Git - lemmy.git/commitdiff
Adding to slur filter.
authorDessalines <tyhou13@gmx.com>
Wed, 18 Sep 2019 19:00:41 +0000 (12:00 -0700)
committerDessalines <tyhou13@gmx.com>
Wed, 18 Sep 2019 19:00:41 +0000 (12:00 -0700)
server/src/lib.rs

index 7cd20bf827584471d602bb744336ba71ed565c06..9caf2779b1eb72e74d17963acb067cba088285a6 100644 (file)
@@ -90,11 +90,11 @@ mod tests {
 
   #[test]
   fn test_slur_filter() {
-    let test = "coons test dindu ladyboy tranny. This is a bunch of other safe text.".to_string();
+    let test = "coons test dindu ladyboy tranny retardeds. This is a bunch of other safe text.".to_string();
     let slur_free = "No slurs here";
     assert_eq!(
       remove_slurs(&test),
-      "*removed* test *removed* *removed* *removed*. This is a bunch of other safe text."
+      "*removed* test *removed* *removed* *removed* *removed*. This is a bunch of other safe text."
         .to_string()
     );
     assert!(has_slurs(&test));
@@ -105,5 +105,5 @@ 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 = Regex::new(r"(fag(g|got|tard)?|maricos?|cock\s?sucker(s|ing)?|\bnig(\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?))").unwrap();
+  static ref SLUR_REGEX: Regex = Regex::new(r"(fag(g|got|tard)?|maricos?|cock\s?sucker(s|ing)?|\bnig(\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?)").unwrap();
 }