Use a subdirectory instead of '_' when keeping the original file name

This commit is contained in:
Les De Ridder 2017-02-17 02:06:15 +01:00
parent 57eeca07c9
commit 2b18b55319
No known key found for this signature in database
GPG Key ID: 5EC132DFA85DB372
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}
}