Closed GoogleCodeExporter closed 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
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:
done in r1062
Original comment by alex.cologne
on 17 Jan 2012 at 7:21
Original issue reported on code.google.com by
spritha...@gmail.com
on 3 Sep 2011 at 4:29