changeset 271a4265fd57 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=271a4265fd57
description: correctly escape file names when showing them in dialogs. Fixes 
#7038

diffstat:

 src/filetransfers_window.py |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r ae51e2969637 -r 271a4265fd57 src/filetransfers_window.py
--- a/src/filetransfers_window.py       Sun Nov 06 11:46:00 2011 +0100
+++ b/src/filetransfers_window.py       Sun Nov 06 12:25:41 2011 +0100
@@ -175,7 +175,8 @@
             (file_path, file_name) = os.path.split(file_props['file-name'])
         else:
             file_name = file_props['name']
-        sectext = '\t' + _('Filename: %s') % file_name
+        sectext = '\t' + _('Filename: %s') % gobject.markup_escape_text(
+            file_name)
         sectext += '\n\t' + _('Size: %s') % \
         helpers.convert_bytes(file_props['size'])
         if file_props['type'] == 'r':
@@ -231,7 +232,8 @@
             file_name = os.path.basename(file_props['file-name'])
         else:
             file_name = file_props['name']
-        sectext = '\t' + _('Filename: %s') % file_name
+        sectext = '\t' + _('Filename: %s') % gobject.markup_escape_text(
+            file_name)
         sectext += '\n\t' + _('Recipient: %s') % jid
         if error_msg:
             sectext += '\n\t' + _('Error message: %s') % error_msg
@@ -328,7 +330,8 @@
             if os.path.exists(file_path):
                 # check if we have write permissions
                 if not os.access(file_path, os.W_OK):
-                    file_name = os.path.basename(file_path)
+                    file_name = gobject.markup_escape_text(os.path.basename(
+                        file_path))
                     dialogs.ErrorDialog(
                         _('Cannot overwrite existing file "%s"' % file_name),
                         _('A file with this name already exists and you do not 
'
@@ -590,7 +593,7 @@
             iter_ = self.model.iter_next(iter_)
 
     def get_send_file_props(self, account, contact, file_path, file_name,
-                    file_desc=''):
+    file_desc=''):
         """
         Create new file_props dict and set initial file transfer properties in 
it
         """
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to