mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
[network/dom] Improve sanitization of download filenames.
This commit is contained in:
parent
b33e80b186
commit
52c03190ee
4 changed files with 26 additions and 3 deletions
|
|
@ -1181,9 +1181,12 @@ nsExternalAppHandler::nsExternalAppHandler(nsIMIMEInfo * aMIMEInfo,
|
|||
mTempFileExtension = char16_t('.');
|
||||
AppendUTF8toUTF16(aTempFileExtension, mTempFileExtension);
|
||||
|
||||
// replace platform specific path separator and illegal characters to avoid any confusion
|
||||
mSuggestedFileName.ReplaceChar(KNOWN_PATH_SEPARATORS FILE_ILLEGAL_CHARACTERS, '_');
|
||||
mTempFileExtension.ReplaceChar(KNOWN_PATH_SEPARATORS FILE_ILLEGAL_CHARACTERS, '_');
|
||||
// Replace platform specific path separator and illegal characters to avoid any confusion
|
||||
mSuggestedFileName.ReplaceChar(KNOWN_PATH_SEPARATORS, '_');
|
||||
mSuggestedFileName.ReplaceChar(FILE_ILLEGAL_CHARACTERS, ' ');
|
||||
mSuggestedFileName.ReplaceChar(char16_t(0), '_');
|
||||
mTempFileExtension.ReplaceChar(KNOWN_PATH_SEPARATORS, '_');
|
||||
mTempFileExtension.ReplaceChar(FILE_ILLEGAL_CHARACTERS, ' ');
|
||||
|
||||
// Remove unsafe bidi characters which might have spoofing implications (bug 511521).
|
||||
const char16_t unsafeBidiCharacters[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue