Last modified: 2008-03-02 21:20:33 UTC
Created attachment 4566 [details] trimmed name triggers the Add item again Steps to reproduce: (Firefox only) 1. go to Wikimedia Commons home page: http://commons.wikimedia.org/wiki/Main_Page 2. click on the icon of the search field in Firefox 3. click "Add Wikimedia Commons {English)" 4. click on the icon of the search field again Results: The search plugin is added with the name "Wikimedia Commons {Engli" instead of the full name. This also triggers the reappearing of the "Add Wikimedia Commons {English)" item, because the browser thinks it hasn't been added yet. Proposed solution: Because the name for Firefox search plugins is limited to 24 characters, Wikimedia could choose to rename the plugin from "Wikimedia Commons {English)" to something like "Wikimedia Commons EN".
It seems that Firefox supports plugin names longer than 24 characters. This is a bug in Wikimedia's http://commons.wikimedia.org/w/opensearch_desc.php : <ShortName>Wikimedia Commons (Engli</ShortName>
Due to the OpenSearch 1.1 Draft 3 specification the ShortName tag must contain 16 or fewer characters, therefore this is a bug in two respects -- it exceeds the limit and trims to a weird place. A suggested fix would be to use the language code instead of the language name, to help reduce the length as the title could easily exceed this, and to trim to 16 characters instead, satisfying the specification. Adding a further global configuration variable might help things further - but probably few website owners would care enough so it would largely go unused.
Switched the description in r31336/r31337 to use the language code, which is more compact. The entire text is now overridable in an 'opensearch-desc' message. (Note this change won't be live on Wikimedia sites immediately.)
Updated in r31469 to use the same desc message for the <link> header as well as the final XML. Should resolve issue with Firefox thinking it wasn't the same search plugin due to different name.