#53913 closed defect (bug) (fixed)
Check theme API response is not an error before operating on it
| Reported by: | pierlo | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.9 |
| Component: | Themes | Version: | 5.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
5 years ago
#1
- Keywords has-patch added
SergeyBiryukov commented on PR #1571:
5 years ago
#4
Thanks for the PR! Merged in https://core.trac.wordpress.org/changeset/51601.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Calling
themes_api( 'query_themes' )may not result in a successful API response and so aWP_Erroris 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
$resis aWP_Error, which this PR fixes.Trac ticket: https://core.trac.wordpress.org/ticket/53913