[wp-trac] [WordPress Trac] #10543: Incorrect (non-UTF-8) character handling in tag's name and slug

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 18 19:31:48 UTC 2009


#10543: Incorrect (non-UTF-8) character handling in tag's name and slug
--------------------------+-------------------------------------------------
 Reporter:  sirzooro      |       Owner:  filosofo   
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  2.9        
Component:  Taxonomy      |     Version:  2.8.2      
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------
Changes (by sirzooro):

  * keywords:  has-patch needs-testing => needs-patch


Comment:

 miqrogroove,
 As I checked, wp_check_invalid_utf8() truncates string, instead of
 dropping invalid chars only. I have just created ticked #11175 to address
 this.

 I have tried to test your patch. Unfortunately it does not work with
 latest nightly build of WP 2.9. When I try to add tag with invalid
 encoding, WP created new tag with empty name and slug set to tag's ID. As
 I checked, sanitize_term_field() calls few filters when $context is set to
 'db'. One of them (pre_term_name) in turn calls following functions:
 sanitize_text_field, wp_filter_kses and _wp_specialchars. One of these
 functions returns empty string when tag contains chars with invalid
 encoding. Looks that you should call wp_check_invalid_utf8() before these
 filters.

 Please also check why WP adds tag with empty name and id as slug.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10543#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list