I have a function of a file uploading. While uploading a file when I run the PHP_CodeSniffer phpcs I am getting the error. I am running WordPress ruleset.
Detected usage of a non-sanitized input variable: $_FILES
$fext = $file = $_FILES['import_file']['name'];
$filename = $_FILES['import_file']['tmp_name'];
Can anyone please tell me how to solve it.
Thanks in advance.