From f4f1dd5a05db0e1c0594714e1cb1cf2b38d42811 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 17 Apr 2009 00:06:18 +0000 Subject: [PATCH] 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 --- wp-includes/pluggable.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 56d2f0b53e..d2d723a3d2 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -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