How to sanitize uploaded file filename from a plugin?
I found a way. Change the lines on wordpress-form-manager plugin direcoty -> types -> file.php (around line 109) From: if($fileNameFormat == “%filename%”){ $newFileName = $pathInfo[‘filename’]; } To: if($fileNameFormat == “%filename%”){ //Sanitize the filename (See note below) $remove_these = array(‘ ‘,’`’,'”‘,’\”,’\\’,”https://wordpress.stackexchange.com/”,’%’); $newFileName = str_replace($remove_these, ”, $pathInfo[‘filename’]); //Make the filename unique $newFileName = time().’-‘.$newFileName; }