Bug 1155154 - Part 3 - Ignore file extension filters with characters that can be interpreted by the file picker. r=smaug

This commit is contained in:
Arnaud Bienner
2015-07-17 01:20:01 +02:00
parent 1481b0cecb
commit b3cc804881
2 changed files with 7 additions and 1 deletions

View File

@@ -7212,6 +7212,10 @@ HTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
filterBundle->GetStringFromName(MOZ_UTF16("videoFilter"),
getter_Copies(extensionListStr));
} else if (token.First() == '.') {
if (token.FindChar(';') >= 0 || token.FindChar('*') >= 0) {
// Ignore this filter as it contains reserved characters
continue;
}
extensionListStr = NS_LITERAL_STRING("*") + token;
filterName = extensionListStr;
atLeastOneFileExtensionFilter = true;