Several bugs with Firefox search plugin generation

Please report bugs here!

Moderator: Thorsten

Post Reply
Olivier Korn
Posts: 2
Joined: Fri Dec 23, 2005 4:57 pm

Several bugs with Firefox search plugin generation

Post by Olivier Korn »

Hi,
  • Line 49 of admin/plugins.firefoxsearch.php should read $plugin_file = 'pmfsearch.src'; in order for search.php to be able to detect the presence of the plugin.
  • admin/plugins.firefoxsearch.php doesn't cope well with accented characters (it doesn't convert user input to UTF-8 before generating pmfsearch.src). Firefox expects this file to be XML compliant (UTF-8 encoded).
Regards,
Olivier.
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

thanks fory your bug report

Post by matteo »

Hi Olivier,
thanks for pointing out these bugs: the first has been introduced in PMF 1.5.5, the latter has been never addressed 'till now so we'll take a look to better handle character encoding.
We'll start working upon these issues in the next days.

Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Need your webserver configuration

Post by matteo »

Hi Olivier,
I was checking the specs and it seems we cannot declare any encoding schema inside the plugin file descriptor (see Sherlock standard and Mycroft extension) in order to be safe from an encoding point of view.
The file would contain only ASCII text so whilst we'll try to find out if a solution could be applied to the PMF code, I'll suggest you to investigate your webserver configuration to fix the issue according to the HTML charset declared in the language file you used for PMF.
Here is an example if your webserver is Apache:
- Language: en
- File language_en.php, charset: iso-8859-1
The suggested webserver configuration will be:

Code: Select all

AddDefaultCharset ISO-8859-1
BUT a more open and suitable configuration will consist on removing the AddDefaultCharset directive:

Code: Select all

#AddDefaultCharset ISO-8859-1
(you must restart Apache in order to use the new settings)

Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Olivier Korn
Posts: 2
Joined: Fri Dec 23, 2005 4:57 pm

Post by Olivier Korn »

Hi matteo,

I didn't try this, but maybe it is sufficient to use htmlentities PHP function with the text in order to convert it to "ASCII" before writing it to pmfsearch.src. What do you think about it?
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

The solution is provided using sourceTextEncoding

Post by matteo »

Hi Olivier,
this is not the solution: you can try by yourself directly opening the .src file in your Firefox searchplugins folder, modify the text within the name tag using some HTML entities e.g. & and then closing&(re)opening Firefox.
I'd suggest you to try firstly to check your webserver configuration and then try what written below.
The real solution seems to be quite complex and not always applicable: in the pmfsearch.src file, you could specify the sourceTextEncoding tag with an integer representing the encoding with which you have written the text value e.g. for the name tag. Unfortunately this integer does not map the whole of the charsets. You could take a look at this incomplete map in InternetSearchDataSource::MapScriptCodeToCharsetName and search for a match.

Currently the PMF Firefox Search Plugin is a trade-off for best fitting in most of the cases.

Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
Thorsten
Posts: 15769
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,
Line 49 of admin/plugins.firefoxsearch.php should read $plugin_file = 'pmfsearch.src'; in order for search.php to be able to detect the presence of the plugin.
This bug ist fixed in CVS and you can test it tomorrow in a stable snapshot.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply