forum.coppermine-gallery.net
Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Preludian on January 15, 2006, 01:51:56 pm
-
Hi, there, I had some problems with the search feature, to be precise it was the keyword listing at the bottom. I have some Umlaute ( äöü) in the keywords and they didn't display correctly there, clicking on a false keyword (k?ln instead of köln) produced no result. But only there! In every other menu the Umlaute work correctly. So after eliminating every other possibility I finally managed to determine the cause.
In the /include/keyword.inc.php in line 40 it states
// Find unique keywords
$keywords_array = array();
while (list($keywords) = mysql_fetch_row($result)) {
$array = explode(" ",$keywords);
foreach($array as $word)
{
[b] if (!in_array($word =strtolower($word),$keywords_array)) $keywords_array[] = $word;;[/b]
}
}
I changed the strtolower to utf_strtolower and everything worked as it should.
Here's the correct line to cut&paste:
if (!in_array($word = utf_strtolower($word),$keywords_array)) $keywords_array[] = $word;
Oh, I have the 1.4.3 stable installed.
bye
-
Thanks for this fix! I was trying to understand why my keywords aren't unique. Is there any reason this sholdn't be rolled into the main trunk?
-
Is there any reason this sholdn't be rolled into the main trunk?
Threads that are in the bugs board section that are not tagged with "invalid" or "fixed" require looking into by the devs. Ifthe fix is valid and doesn't have a negative impact somewhere else (that's why devs have to look into it), it will go into the core.
-
Just to say that we have the same problem in french
http://forum.coppermine-gallery.net/index.php?topic=30329
-
could you summarize the thread you refered to if it helps to fix the issue on this thread?
-
The problem is exacly the same as described above : on the search page, in the keywords list, all accentuated characters (actually, all the multi-byte characters) are misunderstood. The reason is that strtolower lowercases each byte. For instance, é which is read as é in ascii is transformed to ã© which results in a � display. That's why utf_strtolower should be used in keyword.inc.php instead of strtolower as it's already used in keywordmgr.php
-
so does the fix as propossed by Preludian cure the issues?
-
It does.
-
added suggested changes to stable and devel branch of svn. Will go into cpg1.4.6