Hello, I have a contact form in my website. I made a class to handle the whole process. But there is something not working in it.
I have 2 functions to check for exploitation and they are not working. I don't know what's wrong with them, so here they are :
private function _validateExploit($val) {
$exploitPattrens = array('content-type', 'to:', 'bcc:', 'cc:', 'document.cookie', 'document.write', 'onclick', 'onload', '\n', '\r', '\t', '%0A', '%0D', '%08', '%09');
foreach ($exploitPattrens as $exploit) {
if (strpos($exploit, $val) !== false){
return true;
}
}
return false;
}
public function isExploit () {
if(call_user_func_array(array($this, '_validateExploit'), $_POST)) {
echo $errorMsg;
}
}
When I call isExploit()
it always return false, no matter what I give it as an input.
I guess there is something wrong with the call_user_func_array
, but I can't find it.
Thanks in advance!