From: Philipp Date: Sat, 7 Jan 2023 18:54:59 +0000 (+0100) Subject: Fix other foreach() troubles at Addon.php X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9fb5b95b5ee0e9d269bc6982393966062b646509;p=friendica.git Fix other foreach() troubles at Addon.php --- diff --git a/src/Core/Addon.php b/src/Core/Addon.php index 976b9799be..46ba0eec2b 100644 --- a/src/Core/Addon.php +++ b/src/Core/Addon.php @@ -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; }