Bug 1606300 - escape filenames in tab titles, save as... dialog and as used by webbrowserpersist, r=valentin
The getDefaultFileName helper function does its own filename parsing using header info it has previously 'manually' retrieved, so it needs to manually unescape its input. Meanwhile, NS_GetFilenameFromDisposition is used by webbrowserpersist and for the title of documents, and so updating that helps ensure better UI as well as correct filename suggestions when saving from the context menu. Differential Revision: https://phabricator.services.mozilla.com/D61734
This commit is contained in:
@@ -1197,7 +1197,9 @@ function getDefaultFileName(
|
||||
} catch (e) {}
|
||||
}
|
||||
if (fileName) {
|
||||
return validateFileName(fileName);
|
||||
return validateFileName(
|
||||
Services.textToSubURI.unEscapeURIForUI("UTF-8", fileName)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user