MDL-68047 tcpdf: Prevent images out from cache to be removed

This corresponds to https://github.com/tecnickcom/TCPDF/pull/174
(and was fixed bycommit 510070b) and was a regression causing
image files to be removed unconditionally. Only if the images
are from cache, they can be removed.

It's fixed upstream in version 6.3.4 and up.
This commit is contained in:
Eloy Lafuente (stronk7)
2020-04-06 00:29:55 +02:00
parent 1d4fdb0d1c
commit 631d2ad7e2
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@ Description of TCPDF library import 6.3.2
* 18dabac - https://git.io/JeKfU
* 60c9db7 - https://git.io/JeKfT
* 1adcd76 - https://git.io/JeKft
* 5e4d999 - https://git.io/JvrxB
* visit http://127.0.0.1/lib/tests/other/pdflibtestpage.php and view the pdf
Important
+3 -1
View File
@@ -7798,7 +7798,9 @@ class TCPDF {
}
if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) {
unlink($file);
if (strpos($file, K_PATH_CACHE) === 0) {
unlink($file);
}
}
}
}