Prevent crash in case of no list access in cache path

This commit is contained in:
Steffen Keuper 2019-09-30 15:39:53 +02:00
parent 9fde7bb9b4
commit e915d4ac49

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);