I apologise in advance in case I post this in the wrong forum. However I'd like to announce some bug I encountered with the plug-in serendipity_event_freetag and the workaround that fixed it for me.
This report is about serendipity_event_freetag Version 3.23 on Serendipity 1.5.3 (I know it's not current. That's another thing on my todo list) with PHP 5.3.6. Database is MySQL.
== Bug Description: ==
Tags containing special Characters (in my case German umlauts and the sz ligature) cause Database Errors that are passed through to the User.
Example:
Code: Select all
http://www.example.com/index.php?/plugin/tag/Fachkr%E4fte
or
http://www.example.com/index.php?/plugin/tag/Fachkräfte
Code: Select all
Query failed:
SELECT
[... Server rejects my html attachment with the comped Error message. Drop me a note, if you need it]
/ Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
- Query should not fail
- Query should at least fail graceful (i.e. not shout SQL at the user, and possibly reveal innards of the server configuration)
I changed line 996 in serendipity_event_freetag.php
from
Code: Select all
$cond = "entrytags.tag = '$showtag' ";
Code: Select all
$cond = "entrytags.tag = '$showtag' COLLATE utf8_unicode_ci";
That works for me -- however I did not conduct a thorough testing (other database, other character sets, etc.). I just checked that my regular tags still work and that I can no longer reproduce Database errors. However, while
Maybe my workaround helps somebody else as well. I'd be happy to hear about more elegant solutions.
Regards
Vincent
PS: I Know that this can probably be solved by tuning the database, however I do not have full privileges for database that is hosted by a provider.