From 2b18b55319a72e52f7a14560f52bc5459e958db0 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Fri, 17 Feb 2017 02:06:15 +0100 Subject: [PATCH] Use a subdirectory instead of '_' when keeping the original file name --- includes/core.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/core.php b/includes/core.php index 15cd1b6..9f3eb2a 100644 --- a/includes/core.php +++ b/includes/core.php @@ -26,6 +26,7 @@ function save_file ($file, $name, $arg, $type){ $name = stripslashes(str_replace('/', '', $name)); $name = strip_tags(preg_replace('/\s+/', '', $name)); $file_name = gen_name('custom_original', $name); + mkdir(explode("/", $file_name)[0]); $ext = pathinfo($file_name, PATHINFO_EXTENSION); $ext = strtolower($ext); if(in_array($ext, unserialize(CONFIG_BLOCKED_EXTENSIONS))){ @@ -67,7 +68,7 @@ function gen_name($arg, $in){ return $name.($in === NULL ? '' : '.').$in; break; case 'custom_original': - return $name.'_'.$in; + return $name.'/'.$in; break; } }