function AW($f) { if (AD($f, 'I') !== AI) { if (BA($f, 1, 2) == 'BB') { $g = $f; } else { $g = 'BB' . $f; } } elseif (AD($f, 'BE') !== AI) { $g = 'BB' . H('BE', 'I', $f); } elseif (AD($f, 'BE') === AI) { P::Q(); $h = P::$c->BQ($f); if (BR($h) == 1) { return AI; } elseif (BR($h) == 3) { $g = $h[1]; } else { return AI; } } else { $g = $f; } if (BV($g)) { $i = new \BW($g); if ($g != $i->BX()) { return AI; } else { return $g; } } else { return AI; } }
static function check_badwords($str_check = '', $return = false, $del_cache = false) { if ($str_check == "" && !$del_cache) { return false; } for ($i = 65; $i <= 90; $i++) { $str_check = str_replace("&#" . $i . ";", chr($i), $str_check); } for ($i = 97; $i <= 122; $i++) { $str_check = str_replace("&#" . $i . ";", chr($i), $str_check); } $str_check = strip_tags($str_check); $matches = array(); $check = 0; $arr_badword = BW::get_badword(); if (!$del_cache) { foreach ($arr_badword as $badword) { $badword['contents'] = preg_quote($badword['contents']); $badword['contents'] = str_replace(array('\\*', '\\?'), array('(.{0,4})', '(.+)'), $badword['contents']); if ($badword['exact']) { if (preg_match('#(^|\\s|\\b)' . $badword['contents'] . '(\\b|\\s|!|\\?|\\.|,|$)#ui', $str_check, $match)) { if ($return) { $matches[] = $match[0]; } else { return true; } } } else { if (preg_match('#' . $badword['contents'] . '#ui', $str_check, $match)) { if ($return) { $matches[] = $match[0]; } else { return true; } } } } if ($return && $check) { return array('bad' => implode(', ', $matches)); } else { return false; } } }