Make WordPress Core


Ignore:
Timestamp:
11/25/2021 08:34:01 AM (3 years ago)
Author:
audrasjb
Message:

Media: Replace some array keys with their numeric equivalent.

This change replaces ['0'] with [0] which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/media.php

    r52204 r52245  
    37413741        case 'matroska':
    37423742        case 'webm':
    3743             if ( isset( $metadata['matroska']['comments']['creation_time']['0'] ) ) {
    3744                 $creation_date = strtotime( $metadata['matroska']['comments']['creation_time']['0'] );
    3745             } elseif ( isset( $metadata['matroska']['info']['0']['DateUTC_unix'] ) ) {
    3746                 $creation_date = (int) $metadata['matroska']['info']['0']['DateUTC_unix'];
     3743            if ( isset( $metadata['matroska']['comments']['creation_time'][0] ) ) {
     3744                $creation_date = strtotime( $metadata['matroska']['comments']['creation_time'][0] );
     3745            } elseif ( isset( $metadata['matroska']['info'][0]['DateUTC_unix'] ) ) {
     3746                $creation_date = (int) $metadata['matroska']['info'][0]['DateUTC_unix'];
    37473747            }
    37483748            break;
     
    37503750        case 'quicktime':
    37513751        case 'mp4':
    3752             if ( isset( $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'] ) ) {
    3753                 $creation_date = (int) $metadata['quicktime']['moov']['subatoms']['0']['creation_time_unix'];
     3752            if ( isset( $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix'] ) ) {
     3753                $creation_date = (int) $metadata['quicktime']['moov']['subatoms'][0]['creation_time_unix'];
    37543754            }
    37553755            break;
Note: See TracChangeset for help on using the changeset viewer.