Skip to content

Commit

Permalink
Return an empty string as default if no logging is enabled, to not ca…
Browse files Browse the repository at this point in the history
…use a deprecation warning from `esc_textarea()`.

Fixes #473
  • Loading branch information
Clorith committed Jul 25, 2024
1 parent 90d064a commit eaff7b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HealthCheck/Tools/class-health-check-debug-log-viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct() {

private function read_debug_log() {
if ( ! defined( 'WP_DEBUG_LOG' ) || false === WP_DEBUG_LOG ) {
return null;
return '';
}

$logfile = WP_DEBUG_LOG;
Expand All @@ -25,7 +25,7 @@ private function read_debug_log() {
}

if ( ! file_exists( $logfile ) ) {
return null;
return '';
}

$debug_log = @file_get_contents( $logfile );
Expand Down

0 comments on commit eaff7b3

Please sign in to comment.