Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal Error due to improperly accessing body in HTTP request #68

Closed
emmtre opened this issue Oct 10, 2016 · 2 comments
Closed

PHP Fatal Error due to improperly accessing body in HTTP request #68

emmtre opened this issue Oct 10, 2016 · 2 comments
Labels

Comments

@emmtre
Copy link

emmtre commented Oct 10, 2016

Have you seen this PHP errors before? Multisite with PHP 7.0.10 and WP 4.6.1. I noticed a few today in the log but I haven't seen any before.

PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /public_html/wp-content/plugins/ea-share-count/includes/class-core.php:427
Stack trace:
#0 /public_html/wp-content/plugins/ea-share-count/includes/class-core.php(473): EA_Share_Count_Core->query_api('http://...')
#1 /public_html/wp-includes/plugin.php(524): EA_Share_Count_Core->update_share_counts('')
#2 /public_html/wp-includes/load.php(671): do_action('shutdown')
#3 [internal function]: shutdown_action_hook()
#4 {main}
  thrown in /public_html/wp-content/plugins/ea-share-count/includes/class-core.php on line 427
@jaredatch
Copy link
Owner

That's due to the recent HTTP request update in WordPress core.

Instead of calling the content body directly (in an array) we need to leverage wp_remote_retrieve_body

https://codex.wordpress.org/Function_API/wp_remote_retrieve_body

Will fix in the next release.

@jaredatch jaredatch added the bug label Oct 10, 2016
@emmtre
Copy link
Author

emmtre commented Oct 10, 2016

Ok good to know that the problem is on your radar! :-)

@billerickson billerickson changed the title PHP Fatal Error PHP Fatal Error due to improperly accessing body in HTTP request Oct 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants