WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#50893 new defect (bug)

wp_send_json_success is nothing, no error for any inf/nan

Reported by: programmin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.2.5
Component: Media Keywords:
Focuses: Cc:

Description

If wp_send_json_success() has an argument array with INF or Nan in it nothing is printed out, no error is given, this can make it really hard to track down errors in the data of attachments for example.

Steps to reproduce issue:

wp_send_json_success( array('a'=>34/0) );

The fact that can continue and print nothing and nothing but a notice shows how bad PHP can be on multiple levels... :( but there should be some error in this function, or perhaps clean the error since I see it is recursively going through the array for something in _wp_json_sanity_check?

Change History (1)

#1 @programmin
3 months ago

Specifically, this happens whenever metadata is stored that it is "INF" bitrate. Whatever that means. https://www.apostlesba.com/hp_wordpress/wp-content/uploads/2020/07/mp3-1.mp3 for example is one file that will error out the media library of any wp site with that uploaded, and is even worse than the media upload fail in bug #32318

Last edited 3 months ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.