Make WordPress Core


Ignore:
Timestamp:
04/04/2022 08:19:12 PM (3 years 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.

File:
1 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 ) {
Note: See TracChangeset for help on using the changeset viewer.