mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 755551 - Followup, check if the preference has a value, not necessarily a user value, r=josh
This commit is contained in:
parent
881389a4b2
commit
3a8e7786bd
@ -233,12 +233,11 @@ nsInvalidPluginTag::~nsInvalidPluginTag()
|
||||
|
||||
// Helper to check for a MIME in a comma-delimited preference
|
||||
static bool
|
||||
IsTypeInPrefList(nsCString &aMimeType, const char* aPrefName)
|
||||
IsTypeInList(nsCString &aMimeType, nsCString aTypeList)
|
||||
{
|
||||
nsCAutoString searchStr;
|
||||
searchStr.Assign(',');
|
||||
nsAdoptingCString prefStr = Preferences::GetCString(aPrefName);
|
||||
searchStr += prefStr;
|
||||
searchStr.Append(aTypeList);
|
||||
searchStr.Append(',');
|
||||
|
||||
nsACString::const_iterator start, end;
|
||||
@ -2403,11 +2402,12 @@ nsPluginHost::UpdatePluginInfo(nsPluginTag* aPluginTag)
|
||||
/* static */ bool
|
||||
nsPluginHost::IsTypeWhitelisted(const char *aMimeType)
|
||||
{
|
||||
if (!Preferences::HasUserValue(kPrefWhitelist)) {
|
||||
nsAdoptingCString whitelist = Preferences::GetCString(kPrefWhitelist);
|
||||
if (!whitelist.Length()) {
|
||||
return true;
|
||||
}
|
||||
nsDependentCString wrap(aMimeType);
|
||||
return IsTypeInPrefList(wrap, kPrefWhitelist);
|
||||
return IsTypeInList(wrap, whitelist);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
Loading…
Reference in New Issue
Block a user