From 081369e428527dd55ce04206fce9a77cfb5cd580 Mon Sep 17 00:00:00 2001 From: Dominique FERET Date: Tue, 1 Oct 2019 16:28:06 +0200 Subject: [PATCH] Emergency fix: prevent erase users pictures This method has deleted several logo images when we use the rollback function. Added path checking to avoid deleting files elsewhere than in /tmp/ --- tcpdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcpdf.php b/tcpdf.php index 980a0bd..dae6913 100644 --- a/tcpdf.php +++ b/tcpdf.php @@ -7798,7 +7798,7 @@ class TCPDF { } if (isset($this->imagekeys)) { foreach($this->imagekeys as $file) { - if(is_file($file)) unlink($file); + if(substr($file, 0 , 5) === '/tmp/' && is_file($file)) unlink($file); } } }