mirror of
https://github.com/electron/electron.git
synced 2026-01-26 07:48:08 -05:00
Don't use MatchesExtension for matching filters
MatchesExtension compares double extensions like .tar.gz, which does not match the filters.
This commit is contained in:
@@ -211,7 +211,9 @@ base::FilePath FileChooserDialog::AddExtensionForFilename(
|
||||
|
||||
const auto& extensions = filters_[i].second;
|
||||
for (const auto& extension : extensions) {
|
||||
if (extension == "*" || path.MatchesExtension("." + extension))
|
||||
if (extension == "*" ||
|
||||
base::EndsWith(path.value(), "." + extension,
|
||||
base::CompareCase::INSENSITIVE_ASCII))
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user