mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 08:49:56 +09:00
#19191197 파일 이름에 #등의 특수문자가 포함되면 다운로드가 되지 않던 버그 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7809 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f0549e3458
commit
4ad43d052d
1 changed files with 10 additions and 6 deletions
|
|
@ -21,6 +21,11 @@
|
|||
* sync이상없도록 함
|
||||
**/
|
||||
function procFileUpload() {
|
||||
$file_info = Context::get('Filedata');
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 오류 출력
|
||||
if(!is_uploaded_file($file_info['tmp_name'])) exit();
|
||||
|
||||
// 기본적으로 필요한 변수 설정
|
||||
$oFileModel = &getModel('file');
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
|
|
@ -36,10 +41,6 @@
|
|||
// 세션정보에도 정의되지 않았다면 새로 생성
|
||||
if(!$upload_target_srl) $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence();
|
||||
|
||||
$file_info = Context::get('Filedata');
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 오류 출력
|
||||
if(!is_uploaded_file($file_info['tmp_name'])) exit();
|
||||
|
||||
return $this->insertFile($file_info, $module_srl, $upload_target_srl);
|
||||
}
|
||||
|
|
@ -403,10 +404,13 @@
|
|||
$file_info['name'] = str_replace(array('<','>'),array('%3C','%3E'),$file_info['name']);
|
||||
|
||||
$path = sprintf("./files/attach/images/%s/%s", $module_srl,getNumberingPath($upload_target_srl,3));
|
||||
$filename = $path.$file_info['name'];
|
||||
|
||||
// 파일 이름에서 특수문자를 _로 변환
|
||||
$_filename = preg_replace('/[#$&*?+%"\']/', '_', $file_info['name']);
|
||||
$filename = $path.$_filename;
|
||||
$idx = 1;
|
||||
while(file_exists($filename)) {
|
||||
$filename = $path.preg_replace('/\.([a-z0-9]+)$/i','_'.$idx.'.$1',$file_info['name']);
|
||||
$filename = $path.preg_replace('/\.([a-z0-9]+)$/i','_'.$idx.'.$1',$_filename);
|
||||
$idx++;
|
||||
}
|
||||
$direct_download = 'Y';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue