From 1a0ce2d2b33f69df33863ea6359a1b8c811492e9 Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@10967 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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