Make WordPress Core

Ticket #42017: 42017.2.patch

File 42017.2.patch, 2.3 KB (added by desrosj, 6 years ago)

Patch refresh and adding fix for AAC file uploads being blocked.

  • src/wp-admin/includes/media.php

     
    33733373                $metadata['length_formatted'] = $data['playtime_string'];
    33743374        }
    33753375
     3376        if ( empty( $metadata['created_timestamp'] ) ) {
     3377                $created_timestamp = wp_get_media_creation_timestamp( $data );
     3378
     3379                if ( $created_timestamp !== false ) {
     3380                        $metadata['created_timestamp'] = $created_timestamp;
     3381                }
     3382        }
     3383
    33763384        wp_add_id3_tag_data( $metadata, $data );
    33773385
    33783386        return $metadata;
     
    34013409
    34023410        switch ( $metadata['fileformat'] ) {
    34033411                case 'asf':
     3412                case 'wma':
    34043413                        if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) {
    34053414                                $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix'];
    34063415                        }
  • src/wp-includes/functions.php

     
    25422542                        'vtt'                          => 'text/vtt',
    25432543                        'dfxp'                         => 'application/ttaf+xml',
    25442544                        // Audio formats.
     2545                        'aac'                          => 'audio/aac',
    25452546                        'mp3|m4a|m4b'                  => 'audio/mpeg',
    25462547                        'ra|ram'                       => 'audio/x-realaudio',
    25472548                        'wav'                          => 'audio/wav',
  • tests/phpunit/tests/media.php

     
    22282228        }
    22292229
    22302230        /**
     2231         * @ticket 42017
     2232         */
     2233        function test_wp_get_media_creation_timestamp_audio_wma() {
     2234                $metadata = array(
     2235                        'fileformat' => 'wma',
     2236                        'asf'        => array(
     2237                                'file_properties_object' => array(
     2238                                        'creation_date_unix' => 123,
     2239                                ),
     2240                        ),
     2241                );
     2242
     2243                $this->assertEquals( 123, wp_get_media_creation_timestamp( $metadata ) );
     2244        }
     2245
     2246        /**
     2247         * @ticket 42017
     2248         */
     2249        function test_wp_read_audio_metadata_adds_creation_date_with_wma() {
     2250                $video    = DIR_TESTDATA . '/uploads/test.wma';
     2251                $metadata = wp_read_audio_metadata( $video );
     2252
     2253                $this->assertEquals( 1068089812, $metadata['created_timestamp'] );
     2254        }
     2255
     2256        /**
    22312257         * @ticket 35218
    22322258         */
    22332259        function test_wp_get_media_creation_timestamp_video_asf() {