[wp-trac] [WordPress Trac] #61680: is_utf8_charset() undefined when called by code in compat.php

WordPress Trac noreply at wordpress.org
Thu Jul 18 18:05:16 UTC 2024


#61680: is_utf8_charset() undefined when called by code in compat.php
------------------------------------+---------------------
 Reporter:  dmsnell                 |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  high                    |   Milestone:  6.6.1
Component:  General                 |     Version:  6.6
 Severity:  normal                  |  Resolution:
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------
Changes (by jorbin):

 * keywords:  has-patch => has-patch dev-feedback


Comment:

 :facepalm: referenced the wrong ticket in the commit. Copied over below.
 Also keeping open for backport consideration.

 ---

 In [58763]:

 General: Provide _is_utf8_charset() in compat.php for early use

 #61182 introduced is_utf8_charset() as a way of standardizing checks for
 charset slugs referring to UTF-8. This is called by _mb_strlen() inside of
 compat.php, but is_utf8_charset() is defined in functions.php, which isn't
 loaded early on. Code calling mb_strlen() early on before functions.php
 loads in hosts without the multibyte extension therefore may crash.

 Props dmsnell, jonsurrell, joemcgill, jorbin.

 Fixes #61681.

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


More information about the wp-trac mailing list