From a90b05ad036b62c6d75ac885838785ce3c97b5e8 Mon Sep 17 00:00:00 2001 From: Dominique FERET Date: Wed, 2 Oct 2019 07:17:15 +0200 Subject: [PATCH] Better fix for crash and erasing files issue Thank you to @dfontenot for his suggestion. --- tcpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpdf.php b/tcpdf.php index dae6913..db296cc 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -7798,7 +7798,7 @@ class TCPDF { } if (isset($this->imagekeys)) { foreach($this->imagekeys as $file) { - if(substr($file, 0 , 5) === '/tmp/' && is_file($file)) unlink($file); + if(substr($file, 0 , strlen(K_PATH_CACHE)) === K_PATH_CACHE && is_file($file)) unlink($file); } } }