diff --git a/config/func.inc.php b/config/func.inc.php index 9430d113b..e3690d9d5 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -515,7 +515,7 @@ **/ function getScriptPath() { static $url = null; - if($url == null) $url = preg_replace('/\/tools\/([a-z\_]+)/i','',preg_replace('/index.php$/i','',str_replace('\\','/',$_SERVER['SCRIPT_NAME']))); + if($url == null) $url = preg_replace('/\/tools\//i','/',preg_replace('/index.php$/i','',str_replace('\\','/',$_SERVER['SCRIPT_NAME']))); return $url; } diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 7b49d0846..7b85a2946 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -279,8 +279,14 @@ if(!FileHandler::makeDir($path)) return false; // 파일 이동 - if($manual_insert) @copy($file_info['tmp_name'], $filename); - else { + if($manual_insert) { + @copy($file_info['tmp_name'], $filename); + if(!file_exists($filename)) { + $ext = substr(strrchr($file_info['name'],'.'),1); + $filename = $path. md5(crypt(rand(1000000,900000).$file_info['name'])).'.'.$ext; + @copy($file_info['tmp_name'], $filename); + } + } else { if(!@move_uploaded_file($file_info['tmp_name'], $filename)) { $ext = substr(strrchr($file_info['name'],'.'),1); $filename = $path. md5(crypt(rand(1000000,900000).$file_info['name'])).'.'.$ext;