samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Nextgen Tagcloud doesn't support unicode #416

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install Show NextGEN Tagcloud
2. Add a norwegian letter æ, ø or å to a imagetag
3. Click on this tag in the widget, and you get no hits

What is the expected output? What do you see instead?
No picture shows up. 

What version of the product are you using? On what operating system?
1.2

Original issue reported on code.google.com by spritha...@gmail.com on 3 Sep 2011 at 4:29

GoogleCodeExporter commented 8 years ago
I was able to fix this problem by doing the following:
adding the following line

$sluglist=str_replace("%","%%",$sluglist);

into lib/tags.php, just prior to
$term_ids = $wpdb->get_col( $wpdb->prepare("SELECT term_id FROM $wpdb->terms 
WHERE slug IN ($sluglist) ORDER BY term_id ASC "),0);

The source of the problem lies in the way wpdb object treats "%" signs in it's 
queries. If you want it to be literal, and not a template for substitution, you 
have to double it.
You can check the results here (you have to able to read Russian, though :)):
http://home.khris.net/?page_id=1640
(page with tag cloud)
Example of search-by-tag page:
http://home.khris.net/?page_id=1640&gallerytag=%D1%86%D0%B2%D0%B5%D1%82%D1%8B
(this gallery tag means "flowers" in Russian)

Original comment by mrskh...@gmail.com on 13 Sep 2011 at 7:09

GoogleCodeExporter commented 8 years ago
I just tested the proposed change and it does fix the problem for unicode 
characters. 

I created some tags with a % in and some slugs in Cyrillic. In case I chose a 
Cyrillic tag I would get images the images with the tag with a % in as well.

I think this can be safely added to the code. I also created a patch file out 
of the patch from mrskh.

Original comment by kristian...@gmail.com on 16 Jan 2012 at 6:19

Attachments:

GoogleCodeExporter commented 8 years ago
done in r1062

Original comment by alex.cologne on 17 Jan 2012 at 7:21