I added a tweak to this which allows spaces to be completely ignored when comparing a badsubject string with the actual subject string.
It's pretty useful for preventing swearing in the subject line when a poster tries to add his own random spaces in order to fool the system
ORIGINAL:
//Subject
$badsubject = @file("{$config['path']}/filters/badsubject");
if (!is_array($badsubject)) {$badsubject = @file("{$config['phpurl']}/filters/badsubject");}
while (list($linenum,$line) = each($badsubject)) {
if (preg_match("/^#/",$line)) {continue;}
chop ($line);
if (strstr(strtolower($Subject),strtolower($line))) {$html -> not_right($ubbt_lang['BAD_SUBJECT'],$Cat);}
}
//Subject end
TWEAK:
//Subject
$badsubject = @file("{$config['path']}/filters/badsubject");
if (!is_array($badsubject)) {$badsubject = @file("{$config['phpurl']}/filters/badsubject");}
while (list($linenum,$line) = each($badsubject)) {
if (preg_match("/^#/",$line)) {continue;}
$line = chop ($line);
if (strstr(strtolower(trim(eregi_replace(' ', '', $Subject))),strtolower($line))) {$html -> not_right($ubbt_lang['BAD_SUBJECT'],$Cat);}
}
//Subject end