Make WordPress Core


Ignore:
Timestamp:
06/14/2007 02:25:30 AM (19 years ago)
Author:
ryan
Message:

Trim empty lines. Nothing but newline.

File:
1 edited

Legend:

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

    r5683 r5700  
    160160function wp_mail( $to, $subject, $message, $headers = '' ) {
    161161    global $phpmailer;
    162    
     162
    163163    // (Re)create it, if it's gone missing
    164164    if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
     
    167167        $phpmailer = new PHPMailer();
    168168    }
    169    
     169
    170170    // Compact the input, apply the filters, and extract them back out
    171171    extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers' ) ) );
    172    
     172
    173173    // Default headers
    174174    if ( empty( $headers ) ) {
     
    181181        $tempheaders = (array) explode( "\n", $headers );
    182182        $headers = array();
    183        
     183
    184184        // If it's actually got contents
    185185        if ( !empty( $tempheaders ) ) {
     
    188188                // Explode them out
    189189                list( $name, $content ) = explode( ':', trim( $header ), 2 );
    190                
     190
    191191                // Cleanup crew
    192192                $name = trim( $name );
    193193                $content = trim( $content );
    194                
     194
    195195                // Mainly for legacy -- process a From: header if it's there
    196196                if ( $name == 'From' ) {
     
    200200                        $from_name = str_replace( '"', '', $from_name );
    201201                        $from_name = trim( $from_name );
    202                        
     202
    203203                        $from_email = substr( $content, strpos( '<', $content ) + 1 );
    204204                        $from_email = str_replace( '>', '', $from_email );
     
    222222        }
    223223    }
    224    
     224
    225225    // Empty out the values that may be set
    226226    $phpmailer->ClearAddresses();
     
    231231    $phpmailer->ClearCustomHeaders();
    232232    $phpmailer->ClearReplyTos();
    233    
     233
    234234    // From email and name
    235235    // If we don't have a name from the input headers
     
    237237        $from_name = 'WordPress';
    238238    }
    239    
     239
    240240    // If we don't have an email from the input headers
    241241    if ( !isset( $from_email ) ) {
     
    245245            $sitename = substr( $sitename, 4 );
    246246        }
    247        
     247
    248248        $from_email = 'wordpress@' . $sitename;
    249249    }
    250    
     250
    251251    // Set the from name and email
    252252    $phpmailer->From = apply_filters( 'wp_mail_from', $from_email );
    253253    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name );
    254    
     254
    255255    // Set destination address
    256256    $phpmailer->AddAddress( $to );
    257    
     257
    258258    // Set mail's subject and body
    259259    $phpmailer->Subject = $subject;
    260260    $phpmailer->Body = $message;
    261    
     261
    262262    // Set to use PHP's mail()
    263263    $phpmailer->IsMail();
    264    
     264
    265265    // Set Content-Type and charset
    266266    // If we don't have a content-type from the input headers
     
    268268        $content_type = 'text/plain';
    269269    }
    270    
     270
    271271    // Set whether it's plaintext or not, depending on $content_type
    272272    if ( $content_type == 'text/html' ) {
     
    275275        $phpmailer->IsHTML( false );
    276276    }
    277    
     277
    278278    // If we don't have a charset from the input headers
    279279    if ( !isset( $charset ) ) {
    280280        $charset = get_bloginfo( 'charset' );
    281281    }
    282    
     282
    283283    // Set the content-type and charset
    284284    $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' );
    285285    $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
    286    
     286
    287287    // Set custom headers
    288288    if ( !empty( $headers ) ) {
     
    291291        }
    292292    }
    293    
     293
    294294    do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
    295    
     295
    296296    // Send!
    297297    $result = @$phpmailer->Send();
    298    
     298
    299299    return $result;
    300300}
     
    534534
    535535    @wp_mail($user->user_email, $subject, $notify_message, $message_headers);
    536    
     536
    537537    return true;
    538538}
     
    550550    if( get_option( "moderation_notify" ) == 0 )
    551551        return true;
    552    
     552
    553553    $comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
    554554    $post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");
Note: See TracChangeset for help on using the changeset viewer.