Make WordPress Core


Ignore:
Timestamp:
08/06/2008 08:31:54 PM (16 years ago)
Author:
markjaquith
Message:

Cast to array when using foreach(). Props santosj (and thanks for your perseverance!). fixes #2784

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r8564 r8572  
    281281        if ( !empty( $tempheaders ) ) {
    282282            // Iterate through the raw headers
    283             foreach ( $tempheaders as $header ) {
     283            foreach ( (array) $tempheaders as $header ) {
    284284                if ( strpos($header, ':') === false )
    285285                    continue;
     
    364364    // Add any CC and BCC recipients
    365365    if ( !empty($cc) ) {
    366         foreach ($cc as $recipient) {
     366        foreach ( (array) $cc as $recipient ) {
    367367            $phpmailer->AddCc( trim($recipient) );
    368368        }
    369369    }
    370370    if ( !empty($bcc) ) {
    371         foreach ($bcc as $recipient) {
     371        foreach ( (array) $bcc as $recipient) {
    372372            $phpmailer->AddBcc( trim($recipient) );
    373373        }
     
    402402    // Set custom headers
    403403    if ( !empty( $headers ) ) {
    404         foreach ( $headers as $name => $content ) {
     404        foreach( (array) $headers as $name => $content ) {
    405405            $phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) );
    406406        }
     
    790790    while($found) {
    791791        $found = false;
    792         foreach($strip as $val) {
     792        foreach( (array) $strip as $val ) {
    793793            while(strpos($location, $val) !== false) {
    794794                $found = true;
Note: See TracChangeset for help on using the changeset viewer.