[wp-trac] [WordPress Trac] #49209: Site health issue due to issues in processing wp_remote_retrieve_body
WordPress Trac
noreply at wordpress.org
Thu Jan 16 09:51:02 UTC 2020
#49209: Site health issue due to issues in processing wp_remote_retrieve_body
--------------------------------+------------------------------------------
Reporter: aparnascodex | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: rest-api, |
performance |
--------------------------------+------------------------------------------
I have activated one plugin on my site which results in 'Background
updates are not working as expected'.
I found that, the code to validate the http response is not working as
expected.
{{{
if ( 'yes' !== $response) then show warning. (file class-wp-site-health-
auto-updates.php)
}}}
On debugging the issue, I found that the function
**wp_remote_retrieve_body** is returning 'yes' as response. But, I guess
some space is returning with response because of which the above condition
is failing. If I change the condition to if ( 'yes' !== trim($response)),
then it works fine.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/49209>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list