Blocking of common executable filetypes

This commit is contained in:
Jaidyn Lev 2018-11-10 13:57:13 -06:00
parent e980da1b97
commit 397063fcad

View File

@ -6,8 +6,11 @@
function sanitize_filename($filename) function sanitize_filename($filename)
{ {
$death_characters = array(" ", ",", "/", "\\", "%", "$", "^"); $death_characters = array(" ", ",", "/", "\\", "%", "$", "^");
$death_filetypes = array(".php", ".sh", ".lisp", ".cl", ".cgi", ".pl");
$sanitized_filename = str_replace($death_characters, "_", $filename); $sanitized_filename = str_replace($death_characters, "_", $filename);
$sanitized_filename = str_replace($death_filetypes, ".inv",
$sanitized_filename);
return $sanitized_filename; return $sanitized_filename;
} }