Making WordPress.org

Changeset 12162


Ignore:
Timestamp:
10/31/2022 03:52:38 AM (20 months ago)
Author:
dd32
Message:

Translate: Stats: pre-initialise another status array item, to avoid PHP notices.

Some seem to lack the status key (ie. ), defaulting those to 'unknown' for now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/cli/class-stats.php

    r12126 r12162  
    649649        $commenters                     = array();
    650650        $status_counter                 = array(
     651            'changesrequested'       => 0,
    651652            'current'                => 0,
    652653            'current_from_rejection' => 0,
     
    654655            'rejected'               => 0,
    655656            'old'                    => 0,
     657            'unknown'                => 0,
    656658            'waiting'                => 0,
    657659        );
     
    754756                }
    755757            }
    756             $status_counter[ $translation->status ] ++;
     758
     759            $status_counter[ $translation->status ?: 'unknown' ] ++;
    757760        }
    758761
Note: See TracChangeset for help on using the changeset viewer.