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
jenswittmann committed Jan 25, 2024
1 parent 69f55af commit 51dc341
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xpdo/cache/xpdocachemanager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,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 51dc341

Please sign in to comment.