Make WordPress Core

Changeset 57303


Ignore:
Timestamp:
01/17/2024 02:30:47 PM (3 years ago)
Author:
swissspidy
Message:

I18N: Prevent PHP warning in WP_Textdomain_Registry.

Prevents a warning upon cache invalidation after language pack updates if the arguments don’t have the expected format.

Follow-up to [57287], [57290], [57298], [57299].

See #58919.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-textdomain-registry.php

    r57299 r57303  
    229229         */
    230230        public function invalidate_mo_files_cache( $upgrader, $hook_extra ) {
    231                 if ( 'translation' !== $hook_extra['type'] || array() === $hook_extra['translations'] ) {
     231                if (
     232                        ! isset( $hook_extra['type'] ) ||
     233                        'translation' !== $hook_extra['type'] ||
     234                        array() === $hook_extra['translations']
     235                ) {
    232236                        return;
    233237                }
Note: See TracChangeset for help on using the changeset viewer.