Opened 17 years ago
Closed 17 years ago
#9284 closed defect (bug) (fixed)
wp_mail function does not properly process headers array
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 2.8 | Priority: | normal |
| Severity: | normal | Version: | 2.7.1 |
| Component: | Keywords: | has-patch tested | |
| Focuses: | Cc: |
Description
wp_admin is supposed to accept mail headers either as a string or as an array, but if an array is specified the headers are processed differently than if a string is specified.
The fix is below.
Index: pluggable.php
===================================================================
--- pluggable.php (revision 10712)
+++ pluggable.php (working copy)
@@ -275,10 +275,14 @@
// 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 either
+ // string headers or an array of headers.
+ $tempheaders = (array) explode( "\n", $headers );
+ } else {
+ $tempheaders = $headers;
+ }
$headers = array();
// If it's actually got contents
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [10967]) Fix headers array processing for wp_mail(). Props gortsleigh. fixes #9284