Hi Everyone. A real noob question here, Sorry in advance.
I have found a php function online -
public function ft_xss($str, $charset = 'ISO-8859-1') {
/*
* Remove Null Characters
*
* This prevents sandwiching null characters
* between ascii characters, like Java\0script.
*
*/
$str = preg_replace('/\0+/', '', $str);
$str = preg_replace('/(\\\\0)+/', '', $str);
From reading the script, It helps to sanitize against SQL & XSS injection attacks by cleaning user input.
My noob question would be how to use it?
I have the following variable in my php -
$name = $_POST['name'] = filter_var($_POST['name'], FILTER_SANITIZE_STRING);
How can I run the class over my variables ?