Browse Source

Merge branch 'issue-46' into 'staging'

Issue 46

See merge request !46
tags/v0.1.2^2
Big Bad Waffle 7 years ago
parent
commit
48ec217d35
3 changed files with 248 additions and 2 deletions
  1. +14
    -2
      src/server/components/auth.js
  2. +1
    -0
      src/server/misc/messages.js
  3. +233
    -0
      src/server/misc/profanities.js

+ 14
- 2
src/server/components/auth.js View File

@@ -3,13 +3,15 @@ define([
'misc/messages',
'security/connections',
'leaderboard/leaderboard',
'config/skins'
'config/skins',
'misc/profanities'
], function(
io,
messages,
connections,
leaderboard,
skins
skins,
profanities
) {
return {
type: 'auth',
@@ -252,6 +254,11 @@ define([
}
}

if (!profanities.isClean(credentials.username)) {
msg.callback(messages.login.invalid);
return;
}

io.get({
ent: credentials.username,
field: 'login',
@@ -295,6 +302,11 @@ define([
return;
}

if (!profanities.isClean(data.name)) {
msg.callback(messages.login.invalid);
return;
}

io.get({
ent: data.name,
field: 'character',


+ 1
- 0
src/server/misc/messages.js View File

@@ -5,6 +5,7 @@ define([
) {
return {
login: {
invalid: 'invalid name chosen',
exists: 'username exists, please try another',
allFields: 'please complete all fields',
illegal: 'illegal characters in username/password',


+ 233
- 0
src/server/misc/profanities.js View File

@@ -0,0 +1,233 @@
define([

], function(

) {
var config = [
'ahole',
'anal',
'anilingus',
'anus',
'areola',
'ass',
'b1tch',
'ballsack',
'bimbo',
'bitch',
'blowjob',
'bollock',
'boner',
'boob',
'breast',
'breasts',
'bukkake',
'bullshit',
'busty',
'butt',
'cameltoe',
'carpetmuncher',
'chinc',
'chink',
'chode',
'climax',
'clit',
'cock',
'coital',
'condom',
'coon',
'crap',
'cum',
'cunilingus',
'cunnilingus',
'cunt',
'dammit',
'damn',
'dick',
'dike',
'dildo',
'dong',
'douche',
'dumbass',
'dumbasses',
'dyke',
'ejaculate',
'erection',
'erotic',
'fack',
'fag',
'fart',
'felch',
'fellate',
'fellatio',
'feltch',
'fisting',
'fondle',
'foreskin',
'fubar',
'fuck',
'fuk',
'gay',
'goatse',
'godamn',
'goddammit',
'goddamn',
'goldenshower',
'gonad',
'gspot',
'gtfo',
'handjob',
'hardon',
'hell',
'herpes',
'hitler',
'hiv',
'homo',
'hooker',
'hooter',
'horny',
'hump',
'hymen',
'incest',
'jap',
'jerkoff',
'jism',
'jiz',
'kinky',
'kkk',
'labia',
'lech',
'lesbian',
'lesbo',
'lezbian',
'lezbo',
'lube',
'masterbat',
'masturbat',
'menstruat',
'muff',
'nad',
'naked',
'nazi',
'negro',
'nigga',
'nigger',
'nipple',
'nympho',
'oral',
'orgasm',
'orgies',
'orgy',
'pantie',
'panty',
'pedo',
'pee',
'penetrat',
'penial',
'penile',
'penis',
'phalli',
'phuck',
'pimp',
'piss',
'pms',
'poon',
'porn',
'prick',
'prostitut',
'pube',
'pubic',
'pubis',
'puss',
'pussies',
'pussy',
'puto',
'queaf',
'queef',
'queer',
'rape',
'rapist',
'rectal',
'rectum',
'rectus',
'reich',
'retard',
'rimjob',
'ritard',
'rump',
'schlong',
'screw',
'scrote',
'scrotum',
'semen',
'sex',
'shit',
'skank',
'slut',
'smut',
'snatch',
'sodom',
'sperm',
'spunk',
'stfu',
'stiffy',
'strip',
'stroke',
'stupid',
'suck',
'tampon',
'tard',
'teabag',
'teat',
'teste',
'testicle',
'testis',
'thrust',
'tit',
'tramp',
'transsex',
'turd',
'tush',
'twat',
'undies',
'urinal',
'urine',
'uterus',
'vag',
'vagina',
'viagra',
'virgin',
'vomit',
'voyeur',
'vulva',
'wang',
'wank',
'weenie',
'weewee',
'weiner',
'wench',
'wetback',
'whoralicious',
'whore',
'whoring',
'wigger',
'womb',
'woody',
'wtf',
'xxx'
];

var cLen = config.length;

return {
isClean: function(text) {
var cb = text.indexOf.bind(text);

for (var i = 0; i < cLen; i++) {
if (cb(config[i]) > -1)
return false;
}

return true;
}
};
});

Loading…
Cancel
Save