Merge pull request #143 from DaRealFreak/fix/no-list-access

Prevent crash in case of no list access in cache path
This commit is contained in:
Nicola Asuni 2020-02-12 11:01:36 +00:00 committed by GitHub
commit c50c07fade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7788,7 +7788,7 @@ class TCPDF {
if ($destroyall AND !$preserve_objcopy) {
self::$cleaned_ids[$this->file_id] = true;
// remove all temporary files
if ($handle = opendir(K_PATH_CACHE)) {
if ($handle = @opendir(K_PATH_CACHE)) {
while ( false !== ( $file_name = readdir( $handle ) ) ) {
if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0) {
unlink(K_PATH_CACHE.$file_name);