From 0f573ea7d8f5da93ff5221257062a74e17ba3c0b Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Thu, 27 Jun 2024 10:30:49 +0100 Subject: [PATCH] Tweaks --- includes/class-wcpdf-settings.php | 2 ++ includes/wcpdf-functions.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/class-wcpdf-settings.php b/includes/class-wcpdf-settings.php index 07a6a1e5f..4a41de40d 100644 --- a/includes/class-wcpdf-settings.php +++ b/includes/class-wcpdf-settings.php @@ -362,6 +362,8 @@ public function ajax_preview() { } } catch ( \Throwable $th ) { + wcpdf_log_error( 'Error trying to generate document: ' . $th->getTraceAsString(), 'critical' ); + wp_send_json_error( array( 'error' => sprintf( diff --git a/includes/wcpdf-functions.php b/includes/wcpdf-functions.php index a15eca1c6..9e082806e 100644 --- a/includes/wcpdf-functions.php +++ b/includes/wcpdf-functions.php @@ -863,7 +863,7 @@ function wpo_wcpdf_is_file_readable( string $path ): bool { // Local path file check } else { - if ( is_readable( $path ) ) { + if ( @is_readable( $path ) ) { return true; } else { // Fallback to fopen if first check fails