diff --git a/src/xPDO/Cache/xPDOCacheManager.php b/src/xPDO/Cache/xPDOCacheManager.php index 3b7c79f..7b6416a 100644 --- a/src/xPDO/Cache/xPDOCacheManager.php +++ b/src/xPDO/Cache/xPDOCacheManager.php @@ -482,6 +482,9 @@ public function deleteTree($dirname, $options= array('deleteTop' => false, 'skip $handle= opendir($dirname); } $hasMore= false; + if (!is_resource($handle)) { + continue; + } while (false !== ($file= @ readdir($handle))) { if (is_array($excludeItems) && !empty($excludeItems) && in_array($file, $excludeItems)) continue; if (is_array($excludePatterns) && !empty($excludePatterns) && $this->matches($file, $excludePatterns)) continue;