Bug 1809923, r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D167953
This commit is contained in:
Neil Deakin 2023-01-26 16:10:16 +00:00
parent fea63a2dbb
commit bea47874ab

View file

@ -3442,11 +3442,14 @@ nsExternalHelperAppService::ValidateFileNameForSaving(
nsLocalFile::CheckForReservedFileName(fileName); nsLocalFile::CheckForReservedFileName(fileName);
#endif #endif
// If the extension is .lnk or .local, replace it with .download, as these // If the extension is one these types, replace it with .download, as these
// types of files can have signifance on Windows. This happens for any file, // types of files can have signifance on Windows. This happens for any file,
// not just those with the shortcut mime type. // not just those with the shortcut mime type.
if (StringEndsWith(fileName, u".lnk"_ns) || if (StringEndsWith(fileName, u".lnk"_ns, nsCaseInsensitiveStringComparator) ||
StringEndsWith(fileName, u".local"_ns)) { StringEndsWith(fileName, u".local"_ns,
nsCaseInsensitiveStringComparator) ||
StringEndsWith(fileName, u".url"_ns, nsCaseInsensitiveStringComparator) ||
StringEndsWith(fileName, u".scf"_ns, nsCaseInsensitiveStringComparator)) {
fileName.AppendLiteral(".download"); fileName.AppendLiteral(".download");
} }