From 4fe15ccd41ac4733d1676caae41eaadbc918a832 Mon Sep 17 00:00:00 2001 From: Darin Kotter Date: Tue, 21 Nov 2023 14:46:18 -0700 Subject: [PATCH] Avoid fatal error when trying to run a function on a non-array value --- .../classes/InternalConnections/NetworkSiteConnection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index bed72a97f..ac424d647 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -279,10 +279,10 @@ public function pull( $items ) { $current_blog_id = get_current_blog_id(); if ( ! empty( $post_props['meta']['dt_connection_map'] ) ) { - foreach ( $post_props['meta']['dt_connection_map'] as $distributed ) { + foreach ( $post_props['meta']['dt_connection_map'] as $connection_type => $distributed ) { $distributed = maybe_unserialize( $distributed ); - if ( array_key_exists( $current_blog_id, $distributed['internal'] ) ) { + if ( 'internal' === $connection_type && array_key_exists( $current_blog_id, $distributed ) ) { $dt_pull_messages['duplicated'] = 1; continue 2; }