[wp-trac] [WordPress Trac] #36847: PHP Fatal error: Cannot use object of type Requests_Response as array
WordPress Trac
noreply at wordpress.org
Mon May 16 06:45:49 UTC 2016
#36847: PHP Fatal error: Cannot use object of type Requests_Response as array
------------------------------+-----------------------------
Reporter: sebastian.pisula | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
I try update plugin in WordPress and I have fatal:
`[16-May-2016 06:39:46 UTC] PHP Fatal error: Cannot use object of type
Requests_Response as array in \wordpress\wp-includes\http.php on line 255`
Plugins was updated.
My WordPress version: 4.6-alpha-37434
Problem is in:
{{{#!php
<?php
/**
* Retrieve only the response code from the raw response.
*
* Will return an empty array if incorrect parameter value is given.
*
* @since 2.7.0
*
* @param array $response HTTP response.
* @return int|string The response code as an integer. Empty string on
incorrect parameter given.
*/
function wp_remote_retrieve_response_code( $response ) {
if ( is_wp_error($response) || ! isset($response['response']) || !
is_array($response['response']))
return '';
return $response['response']['code'];
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36847>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list