[wp-trac] [WordPress Trac] #63066: Warning when array passed to wp_check_invalid_utf8()

WordPress Trac noreply at wordpress.org
Tue Aug 12 15:57:23 UTC 2025


#63066: Warning when array passed to wp_check_invalid_utf8()
--------------------------+------------------------------
 Reporter:  leedxw        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  6.7.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by siliconforks):

 @garrigan, can you try this?

 {{{#!php
 <?php

 function wp_check_invalid_utf8( $text, $strip = false ) {
         if ( is_array( $text ) ) {
                 error_log( 'should only be passing string; not array to
 wp_check_invalid_utf8()' );
                 ob_start();
                 debug_print_backtrace();
                 error_log( ob_get_clean() );
         }

         $text = (string) $text;
         ...
 }}}

 Modify your `wp-includes/formatting.php` file to include the above code,
 then visit the customizer again, and check your error log file.

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


More information about the wp-trac mailing list