From 1f20c6835a16e4fd92b85ab1546dfabb8893c83a Mon Sep 17 00:00:00 2001 From: Montazar Date: Wed, 12 Jun 2024 10:33:30 +0200 Subject: [PATCH] Fix TypeError in logger expecting array receiving bool --- classes/class-kco-logger.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/classes/class-kco-logger.php b/classes/class-kco-logger.php index 01b85ada..e44463dd 100644 --- a/classes/class-kco-logger.php +++ b/classes/class-kco-logger.php @@ -110,7 +110,7 @@ public static function get_stack() { if ( in_array( $data['function'], array( 'do_action', 'apply_filters' ), true ) ) { if ( isset( $data['object'] ) && $data['object'] instanceof WP_Hook ) { $priority = $data['object']->current_priority(); - $name = key( $data['object']->current() ); + $name = is_array( $data['object']->current() ) ? key( $data['object']->current() ) : ''; $extra_data = $name . ' : ' . $priority; } } @@ -137,5 +137,4 @@ public static function log_to_db( $data ) { $logs = wp_json_encode( $logs ); update_option( 'krokedil_debuglog_kco', $logs, false ); } - }