Mercurial > pidgin
comparison src/ft.c @ 11934:525cf7ecd919
[gaim-migrate @ 14225]
SF Patch #1343380 from Richard Gobeille
'This patch should fix a bug preventing files with ".."
in the filename from being sent. For example,
previously an error would have been thrown when
attempting to transfer a file named something like
"204-bruce_dickinson-no_way_out...to_be_continued.mp3"'
With a change from me... Windows allows both / and \ as path separators, so we need to check for both.
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 31 Oct 2005 20:35:59 +0000 |
parents | 17142948653e |
children | de798f2f4bf1 |
comparison
equal
deleted
inserted
replaced
11933:1b0c83666f98 | 11934:525cf7ecd919 |
---|---|
414 | 414 |
415 buddy = gaim_find_buddy(account, xfer->who); | 415 buddy = gaim_find_buddy(account, xfer->who); |
416 | 416 |
417 if (type == GAIM_XFER_SEND) { | 417 if (type == GAIM_XFER_SEND) { |
418 /* Check the filename. */ | 418 /* Check the filename. */ |
419 if (g_strrstr(filename, "..")) { | 419 #ifdef _WIN32 |
420 if (g_strrstr(filename, "../") || g_strrstr(filename, "..\\")) { | |
421 #else | |
422 if (g_strrstr(filename, "../")) { | |
423 #endif | |
420 char *utf8 = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); | 424 char *utf8 = g_filename_to_utf8(filename, -1, NULL, NULL, NULL); |
421 | 425 |
422 msg = g_strdup_printf(_("%s is not a valid filename.\n"), utf8); | 426 msg = g_strdup_printf(_("%s is not a valid filename.\n"), utf8); |
423 gaim_xfer_error(type, account, xfer->who, msg); | 427 gaim_xfer_error(type, account, xfer->who, msg); |
424 g_free(utf8); | 428 g_free(utf8); |