Fixed a bug in PermissionsReader in PHP 7.3

This commit is contained in:
Matias Griese 2021-10-20 10:24:00 +03:00
parent 280cbc2330
commit 33a5709903
4 changed files with 11 additions and 13 deletions

View File

@ -1,3 +1,9 @@
# v1.7.24
## mm/dd/2021
3. [](#bugfix)
* Fixed a bug in `PermissionsReader` in PHP 7.3
# v1.7.23
## 09/29/2021

View File

@ -138,7 +138,7 @@ class Security
$options = static::getXssDefaults();
}
$list = [];
$list = [[]];
foreach ($array as $key => $value) {
if (is_array($value)) {
$list[] = static::detectXssFromArray($value, $prefix . $key . '.', $options);
@ -148,11 +148,7 @@ class Security
}
}
if (!empty($list)) {
return array_merge(...$list);
}
return $list;
return array_merge(...$list);
}
/**

View File

@ -131,7 +131,7 @@ class PermissionsReader
*/
protected static function getDependencies(array $dependencies): array
{
$list = [];
$list = [[]];
foreach ($dependencies as $name => $deps) {
$current = $deps ? static::getDependencies($deps) : [];
$current[] = $name;

View File

@ -634,7 +634,7 @@ class FolderStorage extends AbstractFilesystemStorage
$flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO | FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS;
$iterator = new FilesystemIterator($path, $flags);
$list = [];
$list = [[]];
/** @var SplFileInfo $info */
foreach ($iterator as $filename => $info) {
if (!$info->isDir() || strpos($info->getFilename(), '.') === 0) {
@ -644,11 +644,7 @@ class FolderStorage extends AbstractFilesystemStorage
$list[] = $this->buildIndexFromFilesystem($filename);
}
if (!$list) {
return [];
}
return count($list) > 1 ? array_merge(...$list) : $list[0];
return array_merge(...$list);
}
/**