function Check4Filtered($headline, $body, $returnbool = false) { global $ANTIRANDOM, $User; $hl_df = defuck_comment($headline); $b_df = defuck_comment($body); $res = DB::Execute("SELECT filText,filReason,filPunishType,filPunishDuration,filReplacement FROM {P}Filters"); $dbg = ''; while (list($fText, $fReason, $fPunishment, $fPunishTime, $fReplacement) = $res->FetchRow()) { // Fastest string search method. $idx = strpos($hl_df . ' ' . $b_df, $fText); if ($idx === false) { continue; } if ($returnbool === true) { return true; } switch ($fPunishment) { case 0: // Just replace $headline = str_ireplace($fText, $fReplacement, $headline); $body = str_ireplace($fText, $fReplacement, $body); break; case 1: // 403 header('HTTP/1.1 403 Forbidden'); Output::HardError("<b>ATBBS has denied your post, as it contains "" . htmlentities($fText) . "", which is banned for the following reason:</b><br />{$fReason}"); break; case 2: // Ban AddBan($User->ID, $_SERVER['REMOTE_ADDR'], $fPunishTime, '<span class="tag filter">Filter</span>' . $fReason, 0); break; default: // Ignore. break; } } $score = GetRandomScore($headline . ' ' . $body); if ($score >= ANTIRANDOM_MAX_SCORE) { if ($returnbool === true) { return true; } header('HTTP/1.1 403 Forbidden'); Output::HardError("Your post contains random data (Score: {$score}, Max score: " . ANTIRANDOM_MAX_SCORE . "). Knock it the f**k off."); exit; } Check4Ban(true); if ($returnbool === true) { return false; } return array($headline, $body); }
$xml['post'] = $message; $ox = $language[5]; $ox = str_replace('{USERNAME}', $handle, $ox); $ox = str_replace('{COLOR}', $color, $ox); $ox = str_replace('{IGNOREIDENT}', $banid, $ox); $write_me .= $ox; } else { if (stristr(mb_substr($message, 0, 5), "/sban")) { $addok = 0; if (CheckFlags("mM", $client['flags'])) { $banid = mb_substr($message, 6, $identlenght); $bantime = mb_substr($message, 6 + $identlenght + 1); if ($bantime + 0 > 604800) { $bantime = 604800; } AddBan($banid, $bantime + time(), $fixhandle, $chatpath); } } else { if ((stristr(mb_substr($message, 0, 5), "/nick") || stristr(mb_substr($message, 0, 5), "/name")) && !CheckBan($ident, $chatpath) && !CheckGag($ident, $chatpath)) { $ident = $_SESSION[$realpath]['ident']; $message = str_replace("_", " ", $message); $message = str_replace(":", " ", $message); $message = str_replace("'", "'", $message); $message = str_replace("\"", "'", $message); $newhandle = mb_substr($message, 6, 40); $xml['post'] = $message; $ox = $language[7]; $ox = str_replace('{USERNAME}', $handle, $ox); $ox = str_replace('{NEWNAME}', $newhandle, $ox); $write_me .= $ox; $handle = $newhandle;
} } } $oldident = $ident; if (!empty($_COOKIE['pJJChat_Banned'])) { $ident = $_COOKIE['pJJChat_Banned']; } if (CheckBan($ident, $chatpath) == 0) { $ident = $oldident; if ($proxyblock == 1 && empty($_SESSION[$realpath]['user']['uid'])) { $bl = Proxy_IsProxy($_SERVER['REMOTE_ADDR']); if ($bl !== false) { echo "This chat blocks open proxies, and you are using one. You have been banned for 8 hours."; echo "<br>The list that caught you is: <a href='{$bl}'>{$bl}</a>"; echo "</body></html>"; AddBan($ident, time() + 28800, '[proxy]', $chatpath); setcookie("pJJChat_Banned", $ident, time() + 604800); die; } } } else { setcookie("pJJChat_Banned", $ident, time() + 604800); echo "<html><head></head>\n{$cbodytag}"; echo $language[12]; echo "</body></html>"; exit; } if (empty($jbbc[0])) { $jbbc[0] = "000000"; } if (empty($jbbc[1])) {
echo $ox; echo "</body></html>"; exit; } } } } echo "\n<!-- Before Proxy: " . round(getmicrotime() - $start, 2) . " secs / {$cqs} queries -->\n"; require_once "../common/proxy.php"; if ($proxyblock == 1 && empty($_SESSION[$realpath]['user']['uid'])) { $bl = Proxy_IsProxy($_SERVER['REMOTE_ADDR']); if ($bl !== false) { echo "This chat blocks open proxies, and you are using one. You have been banned for 8 hours."; echo "<br>The list that caught you is: <a href='{$bl}'>{$bl}</a>"; echo "</body></html>"; AddBan($ident, time() + 28800, '[proxy]', $realpath); setcookie("pJJChat_Banned", "{$ident}", time() + 604800); die; } } echo "\n<!-- After Proxy: " . round(getmicrotime() - $start, 2) . " secs / {$cqs} queries -->\n"; if ($memonly <= 1 || CheckFlags('1', $_SESSION[$realpath]['flags'])) { ShowList($realpath); } else { echo $language[0]; } echo "<hr width='75%'><p><a href='{$_SERVER['REQUEST_URI']}'>Refresh</a><br>"; if ($_REQUEST['noimg']) { echo "<a href='{$_SERVER['PHP_SELF']}?noimg=0'>Show Images</a><p>"; } else { echo "<a href='{$_SERVER['PHP_SELF']}?noimg=1'>Hide Images</a><p>";