changeset 21782:bacb8c59230a

Normalize and escape the filename when auto-accepting a file. References #3982.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 05 Dec 2007 04:59:43 +0000
parents 6a287408bc54
children 3b1d7caddc27 2a47eefca6b3
files libpurple/plugins/autoaccept.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/autoaccept.c	Wed Dec 05 01:32:07 2007 +0000
+++ b/libpurple/plugins/autoaccept.c	Wed Dec 05 04:59:43 2007 +0000
@@ -114,22 +114,23 @@
 		case FT_ACCEPT:
 			if (ensure_path_exists(pref))
 			{
-				dirname = g_build_filename(pref, xfer->who, NULL);
+				dirname = g_build_filename(pref, purple_normalize(account, xfer->who), NULL);
 
 				if (!ensure_path_exists(dirname))
 				{
 					g_free(dirname);
 					break;
 				}
-				
-				filename = g_build_filename(dirname, xfer->filename, NULL);
+
+				filename = g_build_filename(dirname,
+						purple_escape_filename(xfer->filename), NULL);
 
 				purple_xfer_request_accepted(xfer, filename);
 
 				g_free(dirname);
 				g_free(filename);
 			}
-			
+
 			purple_signal_connect(purple_xfers_get_handle(), "file-recv-complete", handle,
 								PURPLE_CALLBACK(auto_accept_complete_cb), xfer);
 			break;