From 30d8174ac5f6637088678545d6053633df1e258b Mon Sep 17 00:00:00 2001 From: Sylvain Legrand Date: Fri, 25 Feb 2022 09:26:19 +0100 Subject: [PATCH] Debug TCPDF file name with spaces --- htdocs/includes/tecnickcom/tcpdf/tcpdf.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php index 7e12c501403..2601e7daba8 100644 --- a/htdocs/includes/tecnickcom/tcpdf/tcpdf.php +++ b/htdocs/includes/tecnickcom/tcpdf/tcpdf.php @@ -6881,6 +6881,11 @@ class TCPDF { // DOL CHANGE If we keep this, the image is not visible on pages after the first one. //var_dump($file.' '.(!@TCPDF_STATIC::file_exists($file))); //return false; + // try to encode spaces on filename + $tfile = str_replace(' ', '%20', $file); + if (@TCPDF_STATIC::file_exists($tfile)) { + $file = $tfile; + } } if (($imsize = @getimagesize($file)) === FALSE) { if (in_array($file, $this->imagekeys)) {