Bug 271981 JS strict warning: redeclaration of var charset r=biesi sr=bz
git-svn-id: svn://10.0.0.236/trunk@165876 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
1e0901d4d1
commit
4c179105fe
@ -724,20 +724,12 @@ function getDefaultFileName(aDefaultFileName, aDocumentURI, aDocument)
|
||||
var url = aDocumentURI.QueryInterface(Components.interfaces.nsIURL);
|
||||
if (url.fileName != "") {
|
||||
// 2) Use the actual file name, if present
|
||||
return validateFileName(decodeURIComponent(url.fileName));
|
||||
}
|
||||
} catch (e) {
|
||||
try {
|
||||
// the file name might be non ASCII
|
||||
// try unescape again with a characterSet
|
||||
var textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
|
||||
.getService(Components.interfaces.nsITextToSubURI);
|
||||
var charset = getCharsetforSave(aDocument);
|
||||
return validateFileName(textToSubURI.unEscapeURIForUI(charset, url.fileName));
|
||||
} catch (e) {
|
||||
// This is something like a wyciwyg:, data:, and so forth
|
||||
// URI... no usable filename here.
|
||||
return validateFileName(textToSubURI.unEscapeURIForUI(url.originCharset || "UTF-8", url.fileName));
|
||||
}
|
||||
} catch (e) {
|
||||
// This is something like a data: and so forth URI... no filename here.
|
||||
}
|
||||
|
||||
if (aDocument) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user