Make WordPress Core

Ticket #21554: wp-email.php.diff

File wp-email.php.diff, 1.0 KB (added by lizhenry, 12 years ago)
  • wp-mail.php

     
    7373                                $content_type = trim($line);
    7474                                $content_type = substr($content_type, 14, strlen($content_type) - 14);
    7575                                $content_type = explode(';', $content_type);
    76                                 if ( ! empty( $content_type[1] ) ) {
     76                                if ( ! empty( $content_type[1] ) && stripos( $content_type[1], 'charset' ) !== FALSE ) {
    7777                                        $charset = explode('=', $content_type[1]);
    7878                                        $charset = ( ! empty( $charset[1] ) ) ? trim($charset[1]) : '';
    7979                                }
     
    184184        }
    185185
    186186        if ( function_exists('iconv') && ! empty( $charset ) ) {
    187                 $content = iconv($charset, get_option('blog_charset'), $content);
     187                $content_check = iconv($charset, get_option('blog_charset'), $content);
     188                # If iconv can't read the charset it returns false. Post anyway.
     189                if ( false !== $content_check ) {
     190                        $content = $content_check;
     191                }
    188192        }
    189193
    190194        // Captures any text in the body after $phone_delim as the body