Make WordPress Core

Ticket #28473: 28473.patch

File 28473.patch, 1.3 KB (added by arty.name, 11 years ago)

proposed fix

  • wp-includes/pluggable.php

     
    275275                        // Explode the headers out, so this function can take both
    276276                        // string headers and an array of headers.
    277277                        $tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) );
     278                       
     279                        // Line which starts with space is a continuation of previous line, need to keep them as one
     280                        for ($index = 0; $index < count($tempheaders); $index ++) {
     281                          if ($index > 0 && $tempheaders[$index] && $tempheaders[$index][0] === ' ') {
     282                            $tempheaders[$index - 1] .= "\n" . $tempheaders[$index];
     283                            array_splice($tempheaders, $index, 1);
     284                            $index--;
     285                          }
     286                        }
    278287                } else {
    279288                        $tempheaders = $headers;
    280289                }
     
    308317                                                        $from_name = substr( $content, 0, strpos( $content, '<' ) - 1 );
    309318                                                        $from_name = str_replace( '"', '', $from_name );
    310319                                                        $from_name = trim( $from_name );
     320                                                        if (function_exists('mb_decode_mimeheader')):
     321                                                          $from_name = mb_decode_mimeheader($from_name);
     322                                                        endif;
    311323
    312324                                                        $from_email = substr( $content, strpos( $content, '<' ) + 1 );
    313325                                                        $from_email = str_replace( '>', '', $from_email );