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

git-svn-id: https://develop.svn.wordpress.org/trunk@10967 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-04-17 00:06:18 +00:00
parent 3cee48146f
commit f4f1dd5a05
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