mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Mail: Replace empty site title with domain name in email subjects.
This change replaces site title with domain name in email subjects when the `blogname` option is empty. Props Presskopp, kebbet, audrasjb, azouamauriac. Fixes #54760. Built from https://develop.svn.wordpress.org/trunk@53063 git-svn-id: http://core.svn.wordpress.org/trunk@52652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b8bc65042a
commit
267ebcec09
@ -1236,9 +1236,15 @@ class WP_Automatic_Updater {
|
||||
$body[] = __( 'https://wordpress.org/support/forums/' );
|
||||
$body[] = "\n" . __( 'The WordPress Team' );
|
||||
|
||||
if ( '' !== get_option( 'blogname' ) ) {
|
||||
$site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
||||
} else {
|
||||
$site_title = parse_url( home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
$body = implode( "\n", $body );
|
||||
$to = get_site_option( 'admin_email' );
|
||||
$subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
|
||||
$subject = sprintf( $subject, $site_title );
|
||||
$headers = '';
|
||||
|
||||
$email = compact( 'to', 'subject', 'body', 'headers' );
|
||||
@ -1347,7 +1353,11 @@ class WP_Automatic_Updater {
|
||||
$body[] = '';
|
||||
}
|
||||
|
||||
$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
|
||||
if ( '' !== get_bloginfo( 'name' ) ) {
|
||||
$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
|
||||
} else {
|
||||
$site_title = parse_url( home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
if ( $failures ) {
|
||||
$body[] = trim(
|
||||
|
@ -1472,12 +1472,18 @@ All at ###SITENAME###
|
||||
$content = str_replace( '###SITENAME###', wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), $content );
|
||||
$content = str_replace( '###SITEURL###', home_url(), $content );
|
||||
|
||||
if ( '' !== get_option( 'blogname' ) ) {
|
||||
$site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
||||
} else {
|
||||
$site_title = parse_url( home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
wp_mail(
|
||||
$value,
|
||||
sprintf(
|
||||
/* translators: New admin email address notification email subject. %s: Site title. */
|
||||
__( '[%s] New Admin Email Address' ),
|
||||
wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
|
||||
$site_title
|
||||
),
|
||||
$content
|
||||
);
|
||||
|
@ -578,6 +578,12 @@ function admin_created_user_email( $text ) {
|
||||
$roles = get_editable_roles();
|
||||
$role = $roles[ $_REQUEST['role'] ];
|
||||
|
||||
if ( '' !== get_bloginfo( 'name' ) ) {
|
||||
$site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
|
||||
} else {
|
||||
$site_title = parse_url( home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
/* translators: 1: Site title, 2: Site URL, 3: User role. */
|
||||
__(
|
||||
@ -590,7 +596,7 @@ this email. This invitation will expire in a few days.
|
||||
Please click the following link to activate your user account:
|
||||
%%s'
|
||||
),
|
||||
wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
|
||||
$site_title,
|
||||
home_url(),
|
||||
wp_specialchars_decode( translate_user_role( $role['name'] ) )
|
||||
);
|
||||
|
@ -112,6 +112,12 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' === $_REQUEST['action'] ) {
|
||||
|
||||
$switched_locale = switch_to_locale( get_user_locale( $user_details ) );
|
||||
|
||||
if ( '' !== get_option( 'blogname' ) ) {
|
||||
$site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
||||
} else {
|
||||
$site_title = parse_url( home_url(), PHP_URL_HOST );
|
||||
}
|
||||
|
||||
/* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */
|
||||
$message = __(
|
||||
'Hi,
|
||||
@ -127,7 +133,7 @@ Please click the following link to confirm the invite:
|
||||
$new_user_email['subject'] = sprintf(
|
||||
/* translators: Joining confirmation notification email subject. %s: Site title. */
|
||||
__( '[%s] Joining Confirmation' ),
|
||||
wp_specialchars_decode( get_option( 'blogname' ) )
|
||||
$site_title
|
||||
);
|
||||
$new_user_email['message'] = sprintf(
|
||||
$message,
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.0-alpha-53062';
|
||||
$wp_version = '6.0-alpha-53063';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user