March 16, 201016 yr Hey i was wondering will my function protect againest most header injection attempts <?php function DOprotect($string){ // OUR PROTECT FUNCTION $string = stripslashes($string); $string = trim($string); $string = strip_tags($string); //Header inject protection $find = array( 'bcc:', 'cc:', 'to:', 'from:', 'content-type:', 'mime-version:', 'multipart/mixed', 'content-transfer-encoding:' ); $string = str_replace("@","AT",$string); $string = str_replace($find,"",strtolower($string)); return $string; } ?> Thanks in advance
March 21, 201016 yr The obvious answer, and generally good advice with security, is to try to break it yourself. Your code looks OK at a glance, but I'm not a PHP expert. And however rare anything is, it is still worth covering: security flaws should be closed, just as small minorities of users should be catered for....
Create an account or sign in to comment