Make WordPress Core

Ticket #15827: 15827.patch

File 15827.patch, 1.1 KB (added by SergeyBiryukov, 14 years ago)
  • wp-admin/includes/class-wp-list-table.php

     
    852852                else
    853853                        $this->display_rows_or_placeholder();
    854854
    855                 $rows = ob_get_clean();
     855                $rows = wp_check_invalid_utf8( ob_get_clean(), true );
    856856
    857857                $response = array( 'rows' => $rows );
    858858
  • wp-includes/formatting.php

     
    473473        }
    474474
    475475        // Attempt to strip the bad chars if requested (not recommended)
    476         if ( $strip && function_exists( 'iconv' ) ) {
    477                 return iconv( 'utf-8', 'utf-8', $string );
     476        if ( $strip ) {
     477                if ( function_exists( 'iconv' ) )
     478                        return iconv( 'utf-8', 'utf-8//IGNORE', $string );
     479                elseif ( function_exists( 'mb_convert_encoding' ) )
     480                        return mb_convert_encoding( $string, 'utf-8', 'utf-8' );
    478481        }
    479482
    480483        return '';