From 397063fcadcb66f4aa79ce4f3424decc8675250d Mon Sep 17 00:00:00 2001 From: Jaidyn Lev Date: Sat, 10 Nov 2018 13:57:13 -0600 Subject: [PATCH] Blocking of common executable filetypes --- resources/library/sanitization.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/library/sanitization.php b/resources/library/sanitization.php index 6e9983a..664cad0 100644 --- a/resources/library/sanitization.php +++ b/resources/library/sanitization.php @@ -6,8 +6,11 @@ function sanitize_filename($filename) { $death_characters = array(" ", ",", "/", "\\", "%", "$", "^"); + $death_filetypes = array(".php", ".sh", ".lisp", ".cl", ".cgi", ".pl"); $sanitized_filename = str_replace($death_characters, "_", $filename); + $sanitized_filename = str_replace($death_filetypes, ".inv", + $sanitized_filename); return $sanitized_filename; }