Fix broken audio/video functions when sanitizing ID3 data

This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

See #40075, #40085.

Merges [40400] to the 3.7 branch.

Built from https://develop.svn.wordpress.org/branches/3.7@40470


git-svn-id: http://core.svn.wordpress.org/branches/3.7@40346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2017-04-17 13:48:09 +00:00
parent 85e61d7921
commit 63b4b6a006

View File

@ -2581,7 +2581,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
if ( ! empty( $data[$version]['comments'] ) ) {
foreach ( $data[$version]['comments'] as $key => $list ) {
if ( ! empty( $list ) ) {
$metadata[$key] = reset( $list );
$metadata[$key] = wp_kses_post( reset( $list ) );
// fix bug in byte stream analysis
if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
$metadata[$key] = 'Cop' . $metadata[$key];
@ -2665,8 +2665,6 @@ function wp_read_video_metadata( $file ) {
wp_add_id3_tag_data( $metadata, $data );
$metadata = wp_kses_post_deep( $metadata );
return $metadata;
}
@ -2706,7 +2704,5 @@ function wp_read_audio_metadata( $file ) {
wp_add_id3_tag_data( $metadata, $data );
$metadata = wp_kses_post_deep( $metadata );
return $metadata;
}