From 1b4f6c1663fd32a07e0a48499b564d037f192c53 Mon Sep 17 00:00:00 2001 From: DustyReagan Date: Wed, 24 Jul 2024 19:04:23 -0500 Subject: [PATCH] Bail if not an array --- .../src/features/wpcom-admin-bar/class-wpcom-admin-bar.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php index bb9bcb5e8fd32..d4aedf14478f5 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-admin-bar/class-wpcom-admin-bar.php @@ -60,12 +60,7 @@ class WPCOM_Admin_Bar extends \WP_Admin_Bar { * } */ public function add_node( $args ) { - // Ensure $args is an array. - if ( is_object( $args ) ) { - $args = (array) $args; - } - - if ( empty( $args['href'] ) ) { + if ( ! is_array( $args ) || empty( $args['href'] ) ) { parent::add_node( $args ); return; }