mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
#19297423 Firefox에서 일부 유니코드 파일명을 가진 파일을 업로드하지 못하는 버그 수정 (Workaround)
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7948 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
8e12962b4c
commit
34fecdbdf7
2 changed files with 6 additions and 1 deletions
|
|
@ -364,8 +364,10 @@ runtimes.html5 = {
|
|||
data += val+'\r\n';
|
||||
});
|
||||
|
||||
// Firefox has a bug that regonises some unicode filename as invalid string.
|
||||
// So, I make a workaround for it encoding the filename applying RFC2231
|
||||
data += '--'+bndr+'\r\n';
|
||||
data += 'Content-Disposition: form-data; name="Filedata"; filename="'+file.name+'"\r\n';
|
||||
data += 'Content-Disposition: form-data; name="Filedata"; filename="=?UTF-8?B?'+Base64.encode(file.name)+'?="\r\n';
|
||||
data += 'Content-Type: application/octet-stream\r\n\r\n';
|
||||
data += file.object.getAsBinary();
|
||||
data += '\r\n';
|
||||
|
|
|
|||
|
|
@ -375,6 +375,9 @@
|
|||
$trigger_obj->upload_target_srl = $upload_target_srl;
|
||||
$output = ModuleHandler::triggerCall('file.insertFile', 'before', $trigger_obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// A workaround for Firefox upload bug
|
||||
if (preg_match('/^=\?UTF-8\?B\?(.+)\?=$/i', $file_info['name'], $match)) $file_info['name'] = base64_decode($match[1]);
|
||||
|
||||
if(!$manual_insert) {
|
||||
// 첨부파일 설정 가져옴
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue