From 746f364ab1646c0d5bf775f60d522861c8c57292 Mon Sep 17 00:00:00 2001 From: costdev Date: Wed, 8 Jan 2025 21:05:34 +0000 Subject: [PATCH] Debug: Filter the contents array to check for an empty file. --- includes/class-debug.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-debug.php b/includes/class-debug.php index 3977a3e..cab628e 100644 --- a/includes/class-debug.php +++ b/includes/class-debug.php @@ -68,7 +68,7 @@ public static function read( $limit = 1000 ) { $file_content = $wp_filesystem->get_contents_array( $file_path, $limit, true ); - if ( ( false === $file_content ) || ( 0 === count( $file_content ) ) ) { + if ( ( false === $file_content ) || ( 0 === count( array_filter( $file_content ) ) ) ) { $file_content = [ esc_html__( '*****Log file is empty.*****', 'aspireupdate' ) ]; }