mirror of
https://github.com/electron/electron.git
synced 2026-02-13 08:35:02 -05:00
Merge pull request #2363 from atom/mime-check
Fix a missing the specified mime type check in <input> accept attribute.
This commit is contained in:
@@ -43,14 +43,15 @@ file_dialog::Filters GetFileTypesFromAcceptType(
|
||||
// Skip the first character.
|
||||
extensions.push_back(extension.substr(1));
|
||||
} else {
|
||||
if (ascii_type == "image/*" || ascii_type == "audio/*" ||
|
||||
ascii_type == "video/*") {
|
||||
// For MIME Type
|
||||
net::GetExtensionsForMimeType(ascii_type, &extensions);
|
||||
}
|
||||
// For MIME Type, `audio/*, vidio/*, image/*
|
||||
net::GetExtensionsForMimeType(ascii_type, &extensions);
|
||||
}
|
||||
}
|
||||
|
||||
// If no valid exntesion is added, return empty filters.
|
||||
if (extensions.empty())
|
||||
return filters;
|
||||
|
||||
filters.push_back(file_dialog::Filter());
|
||||
for (const auto& extension : extensions) {
|
||||
#if defined(OS_WIN)
|
||||
|
||||
Reference in New Issue
Block a user