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:
Gijs Kruitbosch
2020-02-06 18:23:45 +00:00
parent 42abced968
commit ec1fe45310
8 changed files with 102 additions and 1 deletions

View File

@@ -1197,7 +1197,9 @@ function getDefaultFileName(
} catch (e) {}
}
if (fileName) {
return validateFileName(fileName);
return validateFileName(
Services.textToSubURI.unEscapeURIForUI("UTF-8", fileName)
);
}
}