Ticket #42017: 42017.patch
File 42017.patch, 1.8 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/media.php
3150 3150 if ( ! empty( $data['playtime_string'] ) ) 3151 3151 $metadata['length_formatted'] = $data['playtime_string']; 3152 3152 3153 if ( empty( $metadata['created_timestamp'] ) ) { 3154 $created_timestamp = wp_get_media_creation_timestamp( $data ); 3155 3156 if ( $created_timestamp !== false ) { 3157 $metadata['created_timestamp'] = $created_timestamp; 3158 } 3159 } 3160 3153 3161 wp_add_id3_tag_data( $metadata, $data ); 3154 3162 3155 3163 return $metadata; … … 3178 3186 3179 3187 switch ( $metadata['fileformat'] ) { 3180 3188 case 'asf': 3189 case 'wma': 3181 3190 if ( isset( $metadata['asf']['file_properties_object']['creation_date_unix'] ) ) { 3182 3191 $creation_date = (int) $metadata['asf']['file_properties_object']['creation_date_unix']; 3183 3192 } -
tests/phpunit/tests/media.php
2140 2140 } 2141 2141 2142 2142 /** 2143 * @ticket 42017 2144 */ 2145 function test_wp_get_media_creation_timestamp_audio_wma() { 2146 $metadata = array( 2147 'fileformat' => 'wma', 2148 'asf' => array( 2149 'file_properties_object' => array( 2150 'creation_date_unix' => 123, 2151 ), 2152 ), 2153 ); 2154 2155 $this->assertEquals( 123, wp_get_media_creation_timestamp( $metadata ) ); 2156 } 2157 2158 /** 2159 * @ticket 42017 2160 */ 2161 function test_wp_read_audio_metadata_adds_creation_date_with_wma() { 2162 $video = DIR_TESTDATA . '/uploads/test.wma'; 2163 $metadata = wp_read_audio_metadata( $video ); 2164 2165 $this->assertEquals( 1068089812, $metadata['created_timestamp'] ); 2166 } 2167 2168 /** 2143 2169 * @ticket 35218 2144 2170 */ 2145 2171 function test_wp_get_media_creation_timestamp_video_asf() {