From e51152beb31ee51ca78ab5b1d30916c0b40c36f5 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Tue, 26 Jun 2007 18:28:56 +0000 Subject: [PATCH] compare mail headers case-insensitively and actually use the Content-Type specified. Props Nazgul. see: #4296 git-svn-id: https://develop.svn.wordpress.org/trunk@5762 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index f52d5c1483..28457557e5 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -193,7 +193,7 @@ function wp_mail( $to, $subject, $message, $headers = '' ) { $content = trim( $content ); // Mainly for legacy -- process a From: header if it's there - if ( $name == 'From' ) { + if ( 'from' == strtolower($name) ) { if ( strpos($content, '<' ) !== false ) { // So... making my life hard again? $from_name = substr( $content, 0, strpos( $content, '<' ) - 1 ); @@ -206,7 +206,7 @@ function wp_mail( $to, $subject, $message, $headers = '' ) { } else { $from_name = trim( $content ); } - } elseif ( $name == 'Content-Type' ) { + } elseif ( 'content-type' == strtolower($name) ) { if ( strpos( $content,';' ) !== false ) { list( $type, $charset ) = explode( ';', $content ); $content_type = trim( $content_type ); @@ -281,7 +281,7 @@ function wp_mail( $to, $subject, $message, $headers = '' ) { } // Set the content-type and charset - $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' ); + $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', $content_type ); $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); // Set custom headers