indieweb / wordpress-indieauth

IndieAuth for WordPress
https://wordpress.org/plugins/indieauth/
MIT License
31 stars 11 forks source link

PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in indieauth/includes/class-indieauth-debug.php:51 #269

Closed janboddez closed 4 months ago

janboddez commented 4 months ago

Ran into this a couple times now. Or rather, seeing it in the logs.

Looks like $result->get_data() (at least when $result->is_error() is true) can also return a WP_Error object (and who knows what else).

https://github.com/indieweb/wordpress-indieauth/blob/06aa13379b1b66a68f61e4c03c1589f314ff8916/includes/class-indieauth-debug.php#L38-L54