#53913 closed defect (bug) (fixed)
Check theme API response is not an error before operating on it
Reported by: | pierlo | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.9 | Priority: | normal |
Severity: | normal | Version: | 5.9 |
Component: | Themes | Keywords: | has-patch |
Focuses: | Cc: |
Description
Fixes a potential bug when calling themes_api( 'query_themes' )
and a successful API response is not received.
Change History (4)
This ticket was mentioned in PR #1571 on WordPress/wordpress-develop by pierlon.
3 years ago
#1
- Keywords has-patch added
#2
@
3 years ago
- Component changed from General to Themes
- Milestone changed from Awaiting Review to 5.9
#3
@
3 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 51601:
SergeyBiryukov commented on PR #1571:
3 years ago
#4
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51601.
Note: See
TracTickets for help on using
tickets.
Calling
themes_api( 'query_themes' )
may not result in a successful API response and so aWP_Error
is intended to be returned, but right before it is there is this block of code:https://github.com/WordPress/wordpress-develop/blob/9b565f7907ca1d4cb32eccc980de98683758df17/src/wp-admin/includes/theme.php#L606-L615
This block of code should not be executed if
$res
is aWP_Error
, which this PR fixes.Trac ticket: https://core.trac.wordpress.org/ticket/53913