[wp-trac] Re: [WordPress Trac] #9055: mb_strcut in wp_html_excerpt seems to count bytes (not characters). Use mb_substr instead?

WordPress Trac wp-trac at lists.automattic.com
Wed Mar 4 20:04:16 GMT 2009


#9055: mb_strcut in wp_html_excerpt seems to count bytes (not characters).  Use
mb_substr instead?
--------------------------------------------+-------------------------------
 Reporter:  demetris                        |        Owner:  nbachiyski
     Type:  defect (bug)                    |       Status:  reopened  
 Priority:  normal                          |    Milestone:  2.8       
Component:  i18n                            |      Version:  2.8       
 Severity:  normal                          |   Resolution:            
 Keywords:  has-patch tested needs-testing  |  
--------------------------------------------+-------------------------------
Changes (by nbachiyski):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 We have a pure php implementation of {{{mb_strcut}}} and if we use
 {{{mb_substr()}}}, we'll need it implemented too for installs, without the
 mbstring extension.

 I now remembered, that in the beginning we used {{{mb_strcut()}}}, because
 we needed to limit database fields, which are counted in bytes. However,
 now we are using it only in {{{wp_html_excerpt}}} in which case
 {{{mb_substr()}}} really makes more sense.

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


More information about the wp-trac mailing list