diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-08-07 09:59:16 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-08-07 09:59:16 +0000 |
commit | f439b6e69036067f1638a574e5a3e715bc898749 (patch) | |
tree | f3483f77d2f87619d8bd54102784bbf948204ddc | |
parent | fc4f046efa8143ebc84c4ed5c44239fa0ea6f362 (diff) | |
download | wordpress-mu-f439b6e69036067f1638a574e5a3e715bc898749.tar.gz wordpress-mu-f439b6e69036067f1638a574e5a3e715bc898749.tar.xz wordpress-mu-f439b6e69036067f1638a574e5a3e715bc898749.zip |
This should avoid invalid emails when site_name isn't set. Thanks Barry! (fixes #381)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1020 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r-- | wp-includes/wpmu-functions.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index e523fcd..6956fb7 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -1117,7 +1117,8 @@ function wpmu_signup_blog_notification($domain, $path, $title, $user, $user_emai $admin_email = get_site_option( "admin_email" ); if( $admin_email == '' ) $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; - $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"; + $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); + $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $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}"); // TODO: Don't hard code activation link. $subject = sprintf(__('Activate %s'), $domain.$path); @@ -1130,7 +1131,8 @@ function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') { $admin_email = get_site_option( "admin_email" ); if( $admin_email == '' ) $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; - $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"; + $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); + $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $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" ); // TODO: Don't hard code activation link. $subject = sprintf(__('Activate %s'), $user); @@ -1413,7 +1415,8 @@ SITE_NAME" ) ); $admin_email = get_site_option( "admin_email" ); if( $admin_email == '' ) $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; - $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"; + $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); + $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $message = $welcome_email; if( empty( $current_site->site_name ) ) $current_site->site_name = "WordPress MU"; @@ -1447,7 +1450,8 @@ SITE_NAME" ); $admin_email = get_site_option( "admin_email" ); if( $admin_email == '' ) $admin_email = 'support@' . $_SERVER[ 'SERVER_NAME' ]; - $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"; + $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) ); + $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; $message = $welcome_email; if( empty( $current_site->site_name ) ) $current_site->site_name = "WordPress MU"; |