Skip to content

Commit

Permalink
Validate Directory resource in xPDOCacheManager->deleteTree() (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
opengeek committed Jan 25, 2024
1 parent cbc6a8e commit ffa5d88
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xPDO/Cache/xPDOCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ffa5d88

Please sign in to comment.