Always decode special characters for email subjects.

props tlovett1, jeremyfelt.
fixes #25346.

Built from https://develop.svn.wordpress.org/trunk@27801


git-svn-id: http://core.svn.wordpress.org/trunk@27636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-28 02:44:15 +00:00
parent e0e8203af0
commit c3ca81ba94
7 changed files with 13 additions and 13 deletions

View File

@ -2420,7 +2420,7 @@ class WP_Automatic_Updater {
*/
$email = apply_filters( 'auto_core_update_email', $email, $type, $core_update, $result );
wp_mail( $email['to'], $email['subject'], $email['body'], $email['headers'] );
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
}
/**
@ -2570,6 +2570,6 @@ Thanks! -- The WordPress Team" );
*/
$email = apply_filters( 'automatic_updates_debug_email', $email, $failures, $this->update_results );
wp_mail( $email['to'], $email['subject'], $email['body'], $email['headers'] );
wp_mail( $email['to'], wp_specialchars_decode( $email['subject'] ), $email['body'], $email['headers'] );
}
}

View File

@ -259,7 +259,7 @@ All at ###SITENAME###
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
$content = str_replace( '###SITEURL###', network_home_url(), $content );
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), get_option( 'blogname' ) ), $content );
wp_mail( $value, sprintf( __( '[%s] New Admin Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
}
add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
@ -328,7 +328,7 @@ All at ###SITENAME###
$content = str_replace( '###SITENAME###', get_site_option( 'site_name' ), $content );
$content = str_replace( '###SITEURL###', network_home_url(), $content );
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), get_option( 'blogname' ) ), $content );
wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), $content );
$_POST['email'] = $current_user->user_email;
}
}

View File

@ -68,7 +68,7 @@ Webmaster
$content = str_replace( '###URL_DELETE###', $url_delete, $content );
$content = str_replace( '###SITE_NAME###', $current_site->site_name, $content );
wp_mail( get_option( 'admin_email' ), "[ " . get_option( 'blogname' ) . " ] ".__( 'Delete My Site' ), $content );
wp_mail( get_option( 'admin_email' ), "[ " . wp_specialchars_decode( get_option( 'blogname' ) ) . " ] ".__( 'Delete My Site' ), $content );
?>
<p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked. ') ?></p>

View File

@ -85,7 +85,7 @@ You\'ve been invited to join \'%1$s\' at
Please click the following link to confirm the invite:
%4$s' );
wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), get_option( 'blogname' ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) );
$redirect = add_query_arg( array('update' => 'add'), 'user-new.php' );
}
}

View File

@ -880,7 +880,7 @@ function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_ema
$from_name,
esc_url( 'http://' . $domain . $path )
);
wp_mail($user_email, $subject, $message, $message_headers);
wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
return true;
}
@ -965,7 +965,7 @@ function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array(
$from_name,
$user
);
wp_mail($user_email, $subject, $message, $message_headers);
wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
return true;
}
@ -1521,7 +1521,7 @@ We hope you enjoy your new site. Thanks!
* @param string $subject Subject of the email.
*/
$subject = apply_filters( 'update_welcome_subject', sprintf( __( 'New %1$s Site: %2$s' ), $current_site->site_name, wp_unslash( $title ) ) );
wp_mail($user->user_email, $subject, $message, $message_headers);
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
return true;
}
@ -1599,7 +1599,7 @@ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() )
* @param string $subject Subject of the email.
*/
$subject = apply_filters( 'update_welcome_user_subject', sprintf( __( 'New %1$s User: %2$s' ), $current_site->site_name, $user->user_login) );
wp_mail($user->user_email, $subject, $message, $message_headers);
wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
return true;
}

View File

@ -1168,7 +1168,7 @@ function wp_notify_postauthor( $comment_id, $deprecated = null ) {
$message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment_id );
foreach ( $emails as $email ) {
@wp_mail( $email, $subject, $notify_message, $message_headers );
@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
}
return true;
@ -1255,7 +1255,7 @@ function wp_notify_moderator($comment_id) {
$message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id );
foreach ( $emails as $email ) {
@wp_mail( $email, $subject, $notify_message, $message_headers );
@wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers );
}
return true;

View File

@ -388,7 +388,7 @@ function retrieve_password() {
*/
$message = apply_filters( 'retrieve_password_message', $message, $key );
if ( $message && !wp_mail($user_email, $title, $message) )
if ( $message && !wp_mail( $user_email, wp_specialchars_decode( $title ), $message ) )
wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );
return true;