[wp-trac] Re: [WordPress Trac] #6867: single_tag_title() prints
empty string on non-latin1 data
WordPress Trac
wp-trac at lists.automattic.com
Thu Jul 17 18:51:04 GMT 2008
#6867: single_tag_title() prints empty string on non-latin1 data
----------------------+-----------------------------------------------------
Reporter: reinkim | Owner: ryan
Type: defect | Status: reopened
Priority: high | Milestone: 2.6.1
Component: Template | Version: 2.6
Severity: critical | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Changes (by smreg):
* status: closed => reopened
* resolution: fixed =>
Comment:
Replying to [comment:10 ryan]:
> I just FIXED it. See [8364]. Don't reopen unless you test the fix and
confirm that it does not work. You can test it by replacing your existing
wp-includes/taxonomy.php with the version here:
>
> http://trac.wordpress.org/export/8364/branches/2.6/wp-
includes/taxonomy.php
As you said, I have replaced the taxonomy.php of 2.6 by the older one as
below. Now it works fine in Chinese.
{{{
if ( 0 == $term )
return 0;
$where = 't.term_id = %d';
} else {
if ( '' === $term = sanitize_title($term) )
return 0;
$where = 't.slug = %s';
}
if ( !empty($taxonomy) )
return $wpdb->get_row( $wpdb->prepare("SELECT tt.term_id,
tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy
as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $term,
$taxonomy), ARRAY_A);
return $wpdb->get_var( $wpdb->prepare("SELECT term_id FROM
$wpdb->terms as t WHERE $where", $term) );
}}}
Besides, I have also test it in Korean (the bug reporter's language). It
also has the same problem in 2.6.
It is a new bug of 2.6, maybe you can check the examples I provided above.
1. When the tag slug is English and the tag name is Chinese. It behaves
normally. Example URL: http://fairyfish.net/tag/database/
2. When the tag slug and the tag name are both Chinese. The
single_tag_title() returns nothing. Example URL:
http://www.clearstudy.cn/archives/tag/%e8%87%aa%e5%ae%9a%e4%b9%89 (the tag
is '自定义')
--
Ticket URL: <http://trac.wordpress.org/ticket/6867#comment:11>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list