Ticket #42017: 42017.2.patch
File 42017.2.patch, 2.3 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/media.php
3373 3373 $metadata['length_formatted'] = $data['playtime_string']; 3374 3374 } 3375 3375 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 3376 3384 wp_add_id3_tag_data( $metadata, $data ); 3377 3385 3378 3386 return $metadata; … … 3401 3409 3402 3410 switch ( $metadata['fileformat'] ) { 3403 3411 case 'asf': 3412 case 'wma': 3404 3413 if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) { 3405 3414 $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix']; 3406 3415 } -
src/wp-includes/functions.php
2542 2542 'vtt' => 'text/vtt', 2543 2543 'dfxp' => 'application/ttaf+xml', 2544 2544 // Audio formats. 2545 'aac' => 'audio/aac', 2545 2546 'mp3|m4a|m4b' => 'audio/mpeg', 2546 2547 'ra|ram' => 'audio/x-realaudio', 2547 2548 'wav' => 'audio/wav', -
tests/phpunit/tests/media.php
2228 2228 } 2229 2229 2230 2230 /** 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 /** 2231 2257 * @ticket 35218 2232 2258 */ 2233 2259 function test_wp_get_media_creation_timestamp_video_asf() {