Skip to content

Commit

Permalink
Fix broken audio/video functions when sanitizing ID3 data
Browse files Browse the repository at this point in the history
This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

Fixes #40075, #40085.

Built from https://develop.svn.wordpress.org/trunk@40400


git-svn-id: http://core.svn.wordpress.org/trunk@40307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
joemcgill committed Apr 10, 2017
1 parent eab25ea commit 4e1f22b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions wp-admin/includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -2982,7 +2982,7 @@ function wp_add_id3_tag_data( &$metadata, $data ) {
if ( ! empty( $data[$version]['comments'] ) ) {
foreach ( $data[$version]['comments'] as $key => $list ) {
if ( 'length' !== $key && ! 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];
Expand Down Expand Up @@ -3072,8 +3072,6 @@ function wp_read_video_metadata( $file ) {

wp_add_id3_tag_data( $metadata, $data );

$metadata = wp_kses_post_deep( $metadata );

return $metadata;
}

Expand Down Expand Up @@ -3119,8 +3117,6 @@ function wp_read_audio_metadata( $file ) {

wp_add_id3_tag_data( $metadata, $data );

$metadata = wp_kses_post_deep( $metadata );

return $metadata;
}

Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.8-alpha-40399';
$wp_version = '4.8-alpha-40400';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit 4e1f22b

Please sign in to comment.