From ff241e52772f6801a3f6188462b28b606f5ea51d Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Thu, 27 Jun 2024 14:52:55 +0100 Subject: [PATCH] Update wcpdf-functions.php --- includes/wcpdf-functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/wcpdf-functions.php b/includes/wcpdf-functions.php index fe262e011..9a547c563 100644 --- a/includes/wcpdf-functions.php +++ b/includes/wcpdf-functions.php @@ -831,15 +831,15 @@ function wpo_wcpdf_get_image_mime_type( string $src ): string { } /** - * Base64 encode image from URL or local path + * Base64 encode file from URL or local path * * @param string $src * * @return string|bool */ -function wpo_wcpdf_base64_encode_image( string $src ) { - $image_data = @file_get_contents( $src ); - return base64_encode( $image_data ) ?? false; +function wpo_wcpdf_base64_encode_file( string $src ) { + $file_data = @file_get_contents( $src ); + return base64_encode( $file_data ) ?? false; } /** @@ -899,7 +899,7 @@ function wpo_wcpdf_get_image_src_in_base64( string $src ): string { return $src; } - $image_base64 = wpo_wcpdf_base64_encode_image( $src ); + $image_base64 = wpo_wcpdf_base64_encode_file( $src ); if ( ! $image_base64 ) { wcpdf_log_error( 'Unable to encode header logo to base64.', 'critical' );