1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-16 15:18:58 +00:00

Fix a bug in web file upload.

This commit is contained in:
Jonathan Xu
2017-01-16 12:18:14 +08:00
parent 4eda955ad6
commit 6a697e6954

View File

@@ -1698,7 +1698,7 @@ parse_mime_header (char *header, RecvFSM *fsm)
*colon = 0;
if (strcmp (header, "Content-Disposition") == 0) {
params = g_strsplit (colon + 1, ";", 0);
params = g_strsplit (colon + 1, ";", 3);
for (p = params; *p != NULL; ++p)
*p = g_strstrip (*p);
@@ -1730,10 +1730,12 @@ parse_mime_header (char *header, RecvFSM *fsm)
for (p = params; *p != NULL; ++p) {
if (strncasecmp (*p, "filename", strlen("filename")) == 0) {
file_name = get_mime_header_param_value (*p);
fsm->file_name = normalize_utf8_path (file_name);
if (!fsm->file_name)
seaf_debug ("File name is not valid utf8 encoding.\n");
g_free (file_name);
if (file_name) {
fsm->file_name = normalize_utf8_path (file_name);
if (!fsm->file_name)
seaf_debug ("File name is not valid utf8 encoding.\n");
g_free (file_name);
}
break;
}
}