Skip to content

Commit

Permalink
Fix Uninitialized string offset 0 at GenerateMimetypeFileBuilder.php#39
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Jun 14, 2022
1 parent ad10cd5 commit d595013
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@
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');
Expand Down

0 comments on commit d595013

Please sign in to comment.