Skip to content

Commit

Permalink
Only use GLOB_BRACE when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Jan 20, 2021
1 parent d156180 commit 43ded02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Iterator/GlobIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public function __construct($glob, $flags = 0)
// glob() does not support [^...] on Windows
('\\' !== DIRECTORY_SEPARATOR || false === strpos($glob, '[^'))
) {
$results = glob($glob, GLOB_BRACE);
// GLOB_BRACE is not available in some environments.
$results = glob($glob, defined('GLOB_BRACE') ? GLOB_BRACE : 0);

// $results may be empty or false if $glob is invalid
if (empty($results)) {
Expand Down

0 comments on commit 43ded02

Please sign in to comment.