From b94c2b52bc3667a7207c06705b3fab99fd4bcd5a Mon Sep 17 00:00:00 2001 From: C* Date: Mon, 11 Jan 2021 12:52:59 +0000 Subject: [PATCH] Fix #646, adds an option to keep existing files intact --- filemanager/config/config.php | 3 +++ filemanager/dialog.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/filemanager/config/config.php b/filemanager/config/config.php index 89e46d32..c6b11a99 100755 --- a/filemanager/config/config.php +++ b/filemanager/config/config.php @@ -260,6 +260,9 @@ 'replace_with' => "_", //convert to lowercase the files and folders name 'lower_case' => false, + //Should we rename (translitareation and convert_space) files that are already on the filesystem (true) + //or only the news files (false => keeps the existing files and folders intact) + 'fix_existing_files' => true, //Add ?484899493349 (time value) to returned images to prevent cache 'add_time_to_img' => false, diff --git a/filemanager/dialog.php b/filemanager/dialog.php index ad3b941f..8a48f64e 100644 --- a/filemanager/dialog.php +++ b/filemanager/dialog.php @@ -1035,7 +1035,7 @@ function extensionSort($x, $y) continue; } $new_name=fix_filename($file,$config); - if($ftp && $file!='..' && $file!=$new_name){ + if($ftp && $file!='..' && $file!=$new_name && !empty($config['fix_existing_files']){ //rename rename_folder($config['current_path'].$subdir.$file,$new_name,$ftp,$config); $file=$new_name; @@ -1138,7 +1138,7 @@ function extensionSort($x, $y) $file_path=$config['current_path'].$rfm_subfolder.$subdir.$file; //check if file have illegal caracter - if($file!=fix_filename($file,$config)){ + if(!empty($config['fix_existing_files'] && $file!=fix_filename($file,$config)){ $file1=fix_filename($file,$config); $file_path1=($config['current_path'].$rfm_subfolder.$subdir.$file1); if(file_exists($file_path1)){