bug 213337: validate file name before presenting it as a suggested filename (2nd part) : r=cbiesinger, sr=jag, a1.6=asa

This commit is contained in:
jshin%mailaps.org 2006-07-29 05:42:29 +00:00
Родитель ffe253b11c
Коммит d3684a2084
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -775,7 +775,7 @@ function getDefaultFileName(aDefaultFileName, aNameFromHeaders, aDocumentURI, aD
var textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"] var textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
.getService(Components.interfaces.nsITextToSubURI); .getService(Components.interfaces.nsITextToSubURI);
var charset = getCharsetforSave(aDocument); var charset = getCharsetforSave(aDocument);
return textToSubURI.unEscapeURIForUI(charset, url.fileName); return validateFileName(textToSubURI.unEscapeURIForUI(charset, url.fileName));
} catch (e) { } catch (e) {
// This is something like a wyciwyg:, data:, and so forth // This is something like a wyciwyg:, data:, and so forth
// URI... no usable filename here. // URI... no usable filename here.