bug #14503 [Finder] Only use GLOB_BRACE when available (dosten)
This PR was squashed before being merged into the 2.6 branch (closes #14503).
Discussion
----------
[Finder] Only use GLOB_BRACE when available
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #14502
| License | MIT
Commits
-------
7632d27
[Finder] Only use GLOB_BRACE when available
This commit is contained in:
commit
8dcc7e3391
@ -671,7 +671,7 @@ class Finder implements \IteratorAggregate, \Countable
|
|||||||
foreach ((array) $dirs as $dir) {
|
foreach ((array) $dirs as $dir) {
|
||||||
if (is_dir($dir)) {
|
if (is_dir($dir)) {
|
||||||
$resolvedDirs[] = $dir;
|
$resolvedDirs[] = $dir;
|
||||||
} elseif ($glob = glob($dir, GLOB_BRACE | GLOB_ONLYDIR)) {
|
} elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
|
||||||
$resolvedDirs = array_merge($resolvedDirs, $glob);
|
$resolvedDirs = array_merge($resolvedDirs, $glob);
|
||||||
} else {
|
} else {
|
||||||
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
|
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
|
||||||
|
Reference in New Issue
Block a user