Make WordPress Core

Ticket #15827: 15827.diff

File 15827.diff, 1.1 KB (added by MikeHansenMe, 10 years ago)

Refreshed

  • src/wp-admin/includes/class-wp-list-table.php

     
    10061006                        $this->display_rows_or_placeholder();
    10071007                }
    10081008
    1009                 $rows = ob_get_clean();
     1009                $rows = wp_check_invalid_utf8( ob_get_clean(), true );
    10101010
    10111011                $response = array( 'rows' => $rows );
    10121012
  • src/wp-includes/formatting.php

     
    697697        }
    698698
    699699        // Attempt to strip the bad chars if requested (not recommended)
    700         if ( $strip && function_exists( 'iconv' ) ) {
    701                 return iconv( 'utf-8', 'utf-8', $string );
     700        if ( $strip ) {
     701                if ( function_exists( 'iconv' ) ) {
     702                        return iconv( 'utf-8', 'utf-8//IGNORE', $string );
     703                } elseif ( function_exists( 'mb_convert_encoding' ) ) {
     704                        return mb_convert_encoding( $string, 'utf-8', 'utf-8' );
     705                }
    702706        }
    703707
    704708        return '';