Bug 161791 - Save As dialog of mail compose window can't handle non-ASCII filename. r=neil
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 09 Apr 2010 13:47:17 +0900
changeset 5410 9a96ffdd608186aa7b9d9e91a69fb58f15a0a010
parent 5409 c7bca06e4b2482923a3e43ab467b20a487b8c2ab
child 5411 bd72fc3badc3704558232805e0e7789a920344fd
push id4175
push userm_kato@ga2.so-net.ne.jp
push dateFri, 09 Apr 2010 05:22:29 +0000
treeherdercomm-central@9a96ffdd6081 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs161791
Bug 161791 - Save As dialog of mail compose window can't handle non-ASCII filename. r=neil
editor/ui/composer/content/ComposerCommands.js
--- a/editor/ui/composer/content/ComposerCommands.js
+++ b/editor/ui/composer/content/ComposerCommands.js
@@ -798,17 +798,17 @@ function GetSuggestedFileName(aDocumentU
     var docURI = null;
     try {
 
       var ioService = GetIOService();
       docURI = ioService.newURI(aDocumentURLString, GetCurrentEditor().documentCharacterSet, null);
       docURI = docURI.QueryInterface(Components.interfaces.nsIURL);
 
       // grab the file name
-      var url = docURI.fileBaseName;
+      var url = validateFileName(decodeURIComponent(docURI.fileBaseName));
       if (url)
         return url+extension;
     } catch(e) {}
   } 
 
   // check if there is a title we can use
   var title = GetDocumentTitle();
   // generate a valid filename, if we can't just go with "untitled"