[wp-trac] [WordPress Trac] #51393: REST API: Inconsistent type for 'media_details' and 'sizes' in attachments controller

WordPress Trac noreply at wordpress.org
Fri Sep 25 02:09:46 UTC 2020


#51393: REST API: Inconsistent type for 'media_details' and 'sizes' in attachments
controller
----------------------------+----------------------
 Reporter:  SergeyBiryukov  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  REST API        |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:  has-patch       |     Focuses:
----------------------------+----------------------

Comment (by SergeyBiryukov):

 In [changeset:"49046" 49046]:
 {{{
 #!CommitTicketReference repository="" revision="49046"
 Tests: Correct the check for image sizes in some REST API attachments
 controller tests.

 If the sizes data could not be retrieved, the controller returns an empty
 object instead of an array.

 This makes sure that the value is in fact an array before proceeding, and
 outputs a proper message in case of failure, instead of an obscure PHP
 error further in the test.

 Follow-up to [49044].

 See #50913, #51393.
 }}}

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


More information about the wp-trac mailing list