Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#55204 closed defect (bug) (fixed)

Error in upload mp3 file with wrong ID3 tags

Reported by: mjkhajeh's profile mjkhajeh Owned by: peterwilsoncc's profile peterwilsoncc
Milestone: 6.0 Priority: normal
Severity: normal Version: 5.9
Component: Media Keywords: has-patch php8 commit
Focuses: administration Cc:

Description (last modified by SergeyBiryukov)

Hello. I wanted to upload this file to the library but got this error:

Fatal error: Uncaught TypeError: number_format(): Argument #1 ($num) must be of type float, string given in /var/www/html/hub/wp-includes/functions.php:425
Stack trace:
#0 /var/www/html/hub/wp-includes/functions.php(425): number_format()
#1 /var/www/html/hub/wp-admin/includes/media.php(369): number_format_i18n()
#2 /var/www/html/hub/wp-admin/async-upload.php(114): media_handle_upload()
#3 {main} thrown in /var/www/html/hub/wp-includes/functions.php on line 425

I figured out the file has the wrong ID3 tags and this is the cause of the error. It can fix simply by adding a condition to check if track_number is numeric.

Thanks.

File: https://mjkhajeh.ir/Ahmad-Solo-Raha-320.mp3

Attachments (2)

Ahmad-Solo-Raha-320.mp3 (9.5 MB) - added by mjkhajeh 2 years ago.
55204.diff (1.4 KB) - added by SergeyBiryukov 2 years ago.

Change History (7)

#1 @SergeyBiryukov
2 years ago

  • Description modified (diff)

@SergeyBiryukov
2 years ago

#2 @SergeyBiryukov
2 years ago

  • Keywords has-patch php8 added
  • Milestone changed from Awaiting Review to 6.0

This ticket was mentioned in Slack in #core by costdev. View the logs.


2 years ago

#4 @costdev
2 years ago

  • Keywords commit added

Per the discussion in the bug scrub, I'm adding the commit keyword for commit consideration.

#5 @peterwilsoncc
2 years ago

  • Owner set to peterwilsoncc
  • Resolution set to fixed
  • Status changed from new to closed

In 53307:

Media: Validate track number ID3 tags before use.

Validate current and total track ID3 tags as numeric before use.

Props mjkhajeh, SergeyBiryukov, costdev.
Fixes #55204.

Note: See TracTickets for help on using tickets.