mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 14:50:17 -04:00
Merge pull request #34791 from nextcloud/backport/32859/stable25
[stable25] Fix Uninitialized string offset 0 at GenerateMimetypeFileBuilder.php#39
This commit is contained in:
commit
d49c7a3bdc
1 changed files with 5 additions and 7 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue