[wp-trac] [WordPress Trac] #29717: wp_check_invalid_utf8 - pcre tricks and failsafes, +mb_convert_encoding, iconv fix, performance

WordPress Trac noreply at wordpress.org
Sun Sep 21 17:10:06 UTC 2014


#29717: wp_check_invalid_utf8 - pcre tricks and failsafes, +mb_convert_encoding,
iconv fix, performance
--------------------------------+------------------------------------------
 Reporter:  askapache           |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  Formatting          |     Version:  trunk
 Severity:  normal              |  Resolution:
 Keywords:  has-patch dev-      |     Focuses:  administration, performance
  feedback                      |
--------------------------------+------------------------------------------

Comment (by askapache):

 Replying to [comment:4 kitchin]:
 > The checks and ini_set() in the `if ($strip ) {}` block only need to be
 run once.
 >
 > The stripos() is only run once so does not save much and is probably
 wrong, since it matches 'utf-16', 'utf-7', etc.
 >
 > Also the inline doc in the patch claims too much, while the old one said
 too little. Maybe this:
 > {{{
 >  * @return string If the string is valid UTF-8 or the blog_charset is
 not UTF-8, the string
 >  is returned unmodified. Otherwise, an empty string is returned, or
 optionally the string
 >  stripped of invalid chars.
 > }}}


 Great feedback kitchin, I have just updated the patch to 29717.3.patch
 with all of your improvements.  Please check it.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29717#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list