Merge pull request #6315 from electron/fix-extension-match

Don't use MatchesExtension for matching filters
This commit is contained in:
Cheng Zhao 2016-07-01 14:14:18 +00:00 committed by GitHub
commit df3e651fbf

View file

@ -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;
}