Make WordPress Core

Changeset 53063


Ignore:
Timestamp:
04/04/2022 08:19:12 PM (20 months ago)
Author:
audrasjb
Message:

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.

Location:
trunk/src/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-automatic-updater.php

    r52539 r53063  
    12371237        $body[] = "\n" . __( 'The WordPress Team' );
    12381238
     1239        if ( '' !== get_option( 'blogname' ) ) {
     1240            $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     1241        } else {
     1242            $site_title = parse_url( home_url(), PHP_URL_HOST );
     1243        }
     1244
    12391245        $body    = implode( "\n", $body );
    12401246        $to      = get_site_option( 'admin_email' );
    1241         $subject = sprintf( $subject, wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) );
     1247        $subject = sprintf( $subject, $site_title );
    12421248        $headers = '';
    12431249
     
    13481354        }
    13491355
    1350         $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
     1356        if ( '' !== get_bloginfo( 'name' ) ) {
     1357            $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
     1358        } else {
     1359            $site_title = parse_url( home_url(), PHP_URL_HOST );
     1360        }
    13511361
    13521362        if ( $failures ) {
  • trunk/src/wp-admin/includes/misc.php

    r53060 r53063  
    14731473    $content      = str_replace( '###SITEURL###', home_url(), $content );
    14741474
     1475    if ( '' !== get_option( 'blogname' ) ) {
     1476        $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     1477    } else {
     1478        $site_title = parse_url( home_url(), PHP_URL_HOST );
     1479    }
     1480
    14751481    wp_mail(
    14761482        $value,
     
    14781484            /* translators: New admin email address notification email subject. %s: Site title. */
    14791485            __( '[%s] New Admin Email Address' ),
    1480             wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
     1486            $site_title
    14811487        ),
    14821488        $content
  • trunk/src/wp-admin/includes/user.php

    r53060 r53063  
    579579    $role  = $roles[ $_REQUEST['role'] ];
    580580
     581    if ( '' !== get_bloginfo( 'name' ) ) {
     582        $site_title = wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES );
     583    } else {
     584        $site_title = parse_url( home_url(), PHP_URL_HOST );
     585    }
     586
    581587    return sprintf(
    582588        /* translators: 1: Site title, 2: Site URL, 3: User role. */
     
    591597%%s'
    592598        ),
    593         wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
     599        $site_title,
    594600        home_url(),
    595601        wp_specialchars_decode( translate_user_role( $role['name'] ) )
  • trunk/src/wp-admin/user-new.php

    r52978 r53063  
    113113            $switched_locale = switch_to_locale( get_user_locale( $user_details ) );
    114114
     115            if ( '' !== get_option( 'blogname' ) ) {
     116                $site_title = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     117            } else {
     118                $site_title = parse_url( home_url(), PHP_URL_HOST );
     119            }
     120
    115121            /* translators: 1: Site title, 2: Site URL, 3: User role, 4: Activation URL. */
    116122            $message = __(
     
    128134                /* translators: Joining confirmation notification email subject. %s: Site title. */
    129135                __( '[%s] Joining Confirmation' ),
    130                 wp_specialchars_decode( get_option( 'blogname' ) )
     136                $site_title
    131137            );
    132138            $new_user_email['message'] = sprintf(
Note: See TracChangeset for help on using the changeset viewer.