Making WordPress.org

Changeset 10943


Ignore:
Timestamp:
05/04/2021 12:21:17 AM (4 years ago)
Author:
dd32
Message:

Translations: When searching checking claimed installed language packs, check the field we expect is set.

This avoids PHP Notices when the incoming data is in an unexpected format (such as generated by an app that doesn't set the PO-Revision-Date header).
This shouldn't be a logical difference, as strtotime() would return false in these situations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/translations/lib.php

    r10310 r10943  
    238238    foreach ( $translations_for_current as $language_pack ) {
    239239        $update = true;
    240         if ( isset( $language_data[ $language_pack['language'] ] ) ) {
     240        if ( isset( $language_data[ $language_pack['language'] ]['PO-Revision-Date'] ) ) {
    241241            $wporg_updated = strtotime( $language_pack['updated'] );
    242242            $site_updated  = strtotime( $language_data[ $language_pack['language'] ]['PO-Revision-Date'] );
Note: See TracChangeset for help on using the changeset viewer.