Problem with imagekeys undefined or unlinked

PR #136 removed problem with undefined `$imagekeys`, but the solution skipped cleaning files in `$imagekeys`.
The problem about this is that `_destroy` function is called 3 times (from `Close` function, as `shutdown_handler` and from `__desctruct` function). Only first time is called as `destroyall == false`, but unset `$imagekeys`. My solution is to preserve `$imagekeys` to be cleaned by call with `$imagekeys == true`.
This commit is contained in:
Vojta Matějka 2019-10-20 15:30:04 +02:00 committed by GitHub
parent 9fde7bb9b4
commit 7dbdfa4051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7796,10 +7796,8 @@ class TCPDF {
}
closedir($handle);
}
if (isset($this->imagekeys)) {
foreach($this->imagekeys as $file) {
unlink($file);
}
foreach($this->imagekeys as $file) {
unlink($file);
}
}
$preserve = array(
@ -7809,6 +7807,7 @@ class TCPDF {
'bufferlen',
'buffer',
'cached_files',
'imagekeys',
'sign',
'signature_data',
'signature_max_length',