Fix other foreach() troubles at Addon.php

This commit is contained in:
Philipp 2023-01-07 19:54:59 +01:00
parent 6454c1dee7
commit 9fb5b95b5e
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432

View File

@ -196,6 +196,10 @@ class Addon
{
$addons = DI::config()->get('addons');
if (empty($addons)) {
return;
}
foreach ($addons as $name => $data) {
$addonname = Strings::sanitizeFilePathItem(trim($name));
$addon_file_path = 'addon/' . $addonname . '/' . $addonname . '.php';
@ -318,6 +322,11 @@ class Addon
{
$visible_addons = [];
$addons = DI::config()->get('addons');
if (empty($addons)) {
return $visible_addons;
}
foreach ($addons as $name => $data) {
$visible_addons[] = $name;
}