Making WordPress.org

Changeset 10631


Ignore:
Timestamp:
01/26/2021 06:51:31 AM (3 years ago)
Author:
ocean90
Message:

WP I18N Teams: Avoid a fatal error if subdomain or latest release of a locale is not yet available.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wp-i18n-teams/inc/locales.php

    r10628 r10631  
    101101
    102102    foreach ( $gp_locales as $locale ) {
    103         $subdomain = $latest_release = '';
    104         if ( ! empty( $wporg_data[ $locale->wp_locale ] ) ) {
    105             $subdomain      = $wporg_data[ $locale->wp_locale ]->subdomain;
    106             $latest_release = $wporg_data[ $locale->wp_locale ]->latest_release;
    107         }
     103        $subdomain      = $wporg_data[ $locale->wp_locale ]->subdomain ?? '';
     104        $latest_release = $wporg_data[ $locale->wp_locale ]->latest_release ?? '';
    108105        $release_status = get_locale_release_status( $subdomain, $latest_release );
     106
    109107        $statuses[ $release_status ]++;
    110108
     
    138136            'sites'                => $sites,
    139137            'subdomain'            => $subdomain,
    140             'rosetta_site_url'     => "https://$subdomain.wordpress.org/",
     138            'rosetta_site_url'     => $subdomain ? "https://$subdomain.wordpress.org/" : '',
    141139            'latest_release'       => $latest_release ? $latest_release : false,
    142140        ];
Note: See TracChangeset for help on using the changeset viewer.