function CheckSpam($theText, $TheURL) { global $spam_msg, $ip, $shout_tb; if ($_SESSION['use_spam_filters'] == 0) { return true; } $count_http = substr_count($theText, "http"); if ($count_http > 1) { $spam_msg = $_SESSION['HTTPLimit']; return false; } $count_content_type = substr_count($theText, "content-type"); if ($count_content_type >= 1) { $spam_msg = $_SESSION['DLSpam']; return false; } $theText .= $TheURL; $ip = $_SERVER['REMOTE_ADDR']; $spam = $_SESSION['badwords' . $shout_tb]; $spam = explode("\r\n", strtolower($spam)); if ($spam[0] != "") { for ($i = 0; $i < @count($spam); $i++) { $str = $spam[$i]; if (strlen($str) > 8 && intval($str)) { if (!check_ip_address($ip, $str)) { $spam_msg = $_SESSION['IPLogged']; return false; break; } } $pos = strpos($theText, $str); if (is_int($pos)) { $spam_msg = $_SESSION['banned_msg']; return false; break; } } } return true; }
function CheckSpam($theText,$TheURL) { global $spam_msg, $jal_table_prefix, $ip; $count_http=substr_count($theText,"http"); if($count_http>1) { $spam_msg=$_SESSION['HTTPLimit']; return false; } $count_content_type=substr_count($theText,"content-type"); if($count_content_type>=1) { $spam_msg=$_SESSION['DLSpam']; return false; } $theText.=$TheURL; $ip = $_SERVER['REMOTE_ADDR']; $conn = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME, $conn); @mysql_query("SET CHARACTER SET 'utf8'", $conn); @mysql_query("SET NAMES utf8", $conn); $spam=array(); $SQL="SELECT option_value FROM ".$jal_table_prefix."options WHERE option_name = 'moderation_keys'"; $spam=mysql_query($SQL,$conn); $sql_create_arr = mysql_fetch_array($spam); $spam= $sql_create_arr[0]; $spam=explode("\r\n",strtolower($spam)); if($spam[0]!="") { for($i=0;$i<@count($spam);$i++) { $str=$spam[$i]; if (strlen($str)>8 && intval($str)) { if(!check_ip_address($ip, $str)) { $spam_msg=$_SESSION['IPLogged']; return false; break; } } $pos=strpos($theText,$str); if(is_int($pos)) { $spam_msg=$_SESSION['DLSpam']; return false; break; } } } return true; }