Fix headers array processing for wp_mail(). Props gortsleigh. fixes #9284

git-svn-id: http://svn.automattic.com/wordpress/trunk@10967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-17 00:06:18 +00:00
parent b50c964869
commit 1a0ce2d2b3
1 changed files with 8 additions and 4 deletions

View File

@ -260,10 +260,14 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
// Headers
if ( empty( $headers ) ) {
$headers = array();
} elseif ( !is_array( $headers ) ) {
// Explode the headers out, so this function can take both
// string headers and an array of headers.
$tempheaders = (array) explode( "\n", $headers );
} else {
if ( !is_array( $headers ) ) {
// Explode the headers out, so this function can take both
// string headers and an array of headers.
$tempheaders = (array) explode( "\n", $headers );
} else {
$tempheaders = $headers;
}
$headers = array();
// If it's actually got contents