[Webkit-unassigned] [Bug 36815] [Qt] [Gtk] Plug-ins having upper case in mime type are failing to load

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 21 23:04:42 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=36815





--- Comment #4 from Paanky <maharana.pankaj at gmail.com>  2010-06-21 23:04:42 PST ---
Another solution to this problem is as below.
---------------------------------------------

As said above the string comparison of mime-types should be case insensitve but I guess here in the below code it goes wrong.

When pluginForMIMEType() is called from findPlugin(), the mime-type string is in lower cases. But the mimeToDescriptions() for PluginPackage have upper case characters as recieved from the plugin library.
Since, mimeToDescriptions().contains(key) will do a case sensitive comparison so the PluginPackage will not be identified for that mime-type.


Code Changes:
-------------
1. In the file "WebCore/plugins/PluginDatabase.cpp", in the function
   "PluginPackage* PluginDatabase::pluginForMIMEType(const String& mimeType)"
   the lines 

   "if (plugin->mimeToDescriptions().contains(key))
            pluginChoices.append(plugin);"

   can be replaced with

   "MIMEToDescriptionsMap::const_iterator map_it = (*it)->mimeToDescriptions().begin();
        MIMEToDescriptionsMap::const_iterator map_end = (*it)->mimeToDescriptions().end();
        for (; map_it != map_end; ++map_it){
            if (equalIgnoringCase(map_it->first, key)){
                pluginChoices.append(plugin);
                continue;
            }
        }

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list