Fix other foreach() troubles at Addon.php
This commit is contained in:
parent
6454c1dee7
commit
9fb5b95b5e
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue