diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2022-06-13 11:58:16 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2022-06-28 15:45:41 +0200 |
commit | 6f3ab2fc9b327903f0c6cde26100d3ebfb13f548 (patch) | |
tree | c251a01077c7a09cc46fd006694c058a0198cbb4 /core/Command | |
parent | a1bc7700439c6f06842d42e67a0474de9faef34d (diff) | |
download | nextcloud-server-6f3ab2fc9b327903f0c6cde26100d3ebfb13f548.tar.gz nextcloud-server-6f3ab2fc9b327903f0c6cde26100d3ebfb13f548.zip |
Fix Uninitialized string offset 0 at GenerateMimetypeFileBuilder.php#39
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php index 97432473722..873744e6f94 100644 --- a/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php +++ b/core/Command/Maintenance/Mimetype/GenerateMimetypeFileBuilder.php @@ -30,17 +30,15 @@ namespace OC\Core\Command\Maintenance\Mimetype; class GenerateMimetypeFileBuilder { /** * Generate mime type list file - * @param $aliases + * + * @param array $aliases * @return string */ public function generateFile(array $aliases): string { // Remove comments - $keys = array_filter(array_keys($aliases), function ($k) { - return $k[0] === '_'; - }); - foreach ($keys as $key) { - unset($aliases[$key]); - } + $aliases = array_filter($aliases, static function ($key) { + return !($key === '' || $key[0] === '_'); + }, ARRAY_FILTER_USE_KEY); // Fetch all files $dir = new \DirectoryIterator(\OC::$SERVERROOT.'/core/img/filetypes'); |