[wp-trac] [WordPress Trac] #46800: protect against bad characters in media attachment metadata

WordPress Trac noreply at wordpress.org
Thu Aug 8 00:39:26 UTC 2019


#46800: protect against bad characters in media attachment metadata
----------------------------------------+------------------------
 Reporter:  donpark                     |       Owner:  joemcgill
     Type:  defect (bug)                |      Status:  accepted
 Priority:  normal                      |   Milestone:  5.3
Component:  Media                       |     Version:  5.2
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------
Changes (by SergeyBiryukov):

 * keywords:   => has-patch needs-unit-tests
 * milestone:  Future Release => 5.3


Comment:

 [attachment:"01-Campuri auri.mp3"] and [attachment:"02-Ein Bischen-
 Frieden.mp3"] are test files from #47846.

 In my testing with them, [attachment:"bad_id3_patch_2.diff"] works as
 expected, but doesn't completely fix the issue: If track number metadata
 is also malformed or in a wrong encoding, there's a PHP warning:
 {{{
 number_format() expects parameter 1 to be float, string given in wp-
 includes/functions.php on line 280
 }}}

 [attachment:"46800.diff"] fixes that and adds a check whether
 `mb_convert_encoding()` exists.

 This could use a unit test.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46800#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list