[wp-trac] [WordPress Trac] #11175: wp_check_invalid_utf8() should drop invalid utf-8 chars only instead of truncating string

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


#11175: wp_check_invalid_utf8() should drop invalid utf-8 chars only instead of
truncating string
--------------------------+-------------------------------------------------
 Reporter:  sirzooro      |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  normal        |   Milestone:  2.9                    
Component:  General       |     Version:  2.9                    
 Severity:  normal        |    Keywords:  has-patch needs-testing
--------------------------+-------------------------------------------------
 When you call wp_check_invalid_utf8() with 2nd param set to true, it tries
 to strip invalid utf-8. Now it removes 1st invalid utf-8 char and all
 chars after it, no matter if they are correct or not. Additionally it can
 print following notice:

 Notice: iconv() [function.iconv]: Detected an illegal character in input
 string in .../wp-includes/formatting.php on line 437

 Attached patch changes this, so function removes invalid chars only.
 Additionally it is less configuration-dependent, because it can use either
 mb_convert_encoding() or iconv().

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11175>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list