mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
업로드가 아닌 첨부파일의 서버내 복사(게시글 복사/이동)시에도 파일명에 의한 오류에 대처하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4379 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0fddaf252f
commit
42cb1bcfaa
2 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue