From 1faa39c205b60f5d133fe4a719e316e17c781349 Mon Sep 17 00:00:00 2001 From: Nick Daugherty <ndaugherty987@gmail.com> Date: Mon, 8 Sep 2014 16:55:13 -0600 Subject: [PATCH] Check for `WP_Error` before using `$info` as an array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `$info` can be a `WP_Error` if something went wrong with the connection…we must handle that condition. Probably need a better way to surface these errors at the time they happen, rather than letting them get stored here, but this is at least a failsafe to prevent fatals. --- includes/class-wp-push-syndication-server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wp-push-syndication-server.php b/includes/class-wp-push-syndication-server.php index 196598c..b67f2ea 100644 --- a/includes/class-wp-push-syndication-server.php +++ b/includes/class-wp-push-syndication-server.php @@ -1143,7 +1143,7 @@ class WP_Push_Syndication_Server { foreach( $slave_post_states as $state ) { foreach( $state as $site_ID => $info ) { - if( !empty( $info[ 'ext_ID' ] ) ) { + if( ! is_wp_error( $info ) && !empty( $info[ 'ext_ID' ] ) ) { $slave_posts[ $site_ID ] = $info[ 'ext_ID' ]; } } -- GitLab