کد PHP:
<?
class jms_security
{
function security($str)
{
$fail = 0;
@stripos($str, "'") !== false ? $fail = 1 : @stripos($str, '"') !== false ? $fail = 1 : @stripos($str, '%3E') !== false ? $fail = 1 : @stripos($str, '%3C') !== false ? $fail = 1 : "";
return $fail;
}
function clear()
{
global $post_text,$get_text,$cook_text,$num_post,$num_get,$num_cook;
unset($post_text,$get_text,$cook_text,$num_post,$num_get,$num_cook);
}
}
$post_text = "";
$get_text = "";
$cook_text = "";
foreach($_POST as $i => $value){$post_text.=stripslashes($_POST[$i])." ";}
foreach($_GET as $i => $value){$get_text.=stripslashes($_GET[$i])." ";}
foreach($_COOKIE as $i => $value){$cook_text.=stripslashes($_COOKIE[$i])." ";}
$security = new jms_security;
$num_post = $security->security($post_text);
$num_get = $security->security($get_text);
$num_cook = $security->security($cook_text);
$result = ($num_post+$num_get+$num_cook);
$security->clear();
if ($result != 0) die(':)');
?>