WordPress.org

Make WordPress Core

Ticket #209: 209.diff

File 209.diff, 708 bytes (added by rob1n, 15 years ago)
  • wp-includes/pluggable.php

     
    161161                        "From: wordpress@" . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])) . "\n" .
    162162                        "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    163163        }
     164       
     165        // Escape the subject according to the blog's set charset
     166        $subject = preg_replace('/([^a-z ])/ie', 'sprintf(\'=%02x\', ord(stripslashes(\'\1\')))', $subject);
     167        $subject = str_replace(' ', '_', $subject);
     168        $subject = "=?$charset?Q?$subject?=";
    164169
    165170        return @mail($to, $subject, $message, $headers);
    166171}