Show
Ignore:
Timestamp:
08/07/07 09:59:16 (1 year ago)
Author:
donncha
Message:

This should avoid invalid emails when site_name isn't set. Thanks Barry! (fixes #381)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/wpmu-functions.php

    r1017 r1020  
    11181118        if( $admin_email == '' ) 
    11191119                $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; 
    1120         $message_headers = "MIME-Version: 1.0\n" . "From: " . get_site_option( "site_name" ) .  " <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
     1120        $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); 
     1121        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    11211122        $message = sprintf(__("To activate your blog, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your blog here:\n\n%s"), $activate_url, "http://{$domain}{$path}"); 
    11221123        // TODO: Don't hard code activation link. 
     
    11311132        if( $admin_email == '' ) 
    11321133                $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; 
    1133         $message_headers = "MIME-Version: 1.0\n" . "From: " . get_site_option( "site_name" ) .  " <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
     1134        $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); 
     1135        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    11341136        $message = sprintf(__("To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n"), "http://{$current_site->domain}{$current_site->path}wp-activate.php?key=$key" ); 
    11351137        // TODO: Don't hard code activation link. 
     
    14141416        if( $admin_email == '' ) 
    14151417                $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; 
    1416         $message_headers = "MIME-Version: 1.0\n" . "From: " . get_site_option( "site_name" ) .  " <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
     1418        $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); 
     1419        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    14171420        $message = $welcome_email; 
    14181421        if( empty( $current_site->site_name ) ) 
     
    14481451        if( $admin_email == '' ) 
    14491452                $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; 
    1450         $message_headers = "MIME-Version: 1.0\n" . "From: " . get_site_option( "site_name" ) .  " <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
     1453        $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); 
     1454        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    14511455        $message = $welcome_email; 
    14521456        if( empty( $current_site->site_name ) )