Skip to content

Commit

Permalink
fix: directory file list step to properly handle glob returns
Browse files Browse the repository at this point in the history
  • Loading branch information
keevan committed Jul 25, 2023
1 parent ebf33da commit d3d01e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/local/step/directory_file_list_trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,13 @@ public function run() {
}

$pathpattern = $path . DIRECTORY_SEPARATOR . $pattern;
$filelist = glob($pathpattern, GLOB_BRACE) || [];
if ($filelist !== false) {
$this->apply_list_constraints($filelist, $returnvalue, $config->sort, $offset, $limit, $includedir, $path);
$filelist = glob($pathpattern, GLOB_BRACE);
if (empty($filelist)) {
$this->log->notice("No files returned", ['pattern' => $pathpattern]);
return [];
}

$this->apply_list_constraints($filelist, $returnvalue, $config->sort, $offset, $limit, $includedir, $path);
return $filelist;
}

Expand Down

0 comments on commit d3d01e1

Please sign in to comment.