diff options
-rw-r--r-- | lib/private/legacy/app.php | 6 | ||||
-rw-r--r-- | settings/ajax/enableapp.php | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 6ce18bc7911..61f639953ec 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -390,8 +390,8 @@ class OC_App { * * This function set an app as enabled in appconfig. */ - public function enable($appId, - $groups = null) { + public function enable(string $appId, + array $groups = []) { self::$enabledAppsCache = []; // flush // Check if app is already downloaded @@ -405,7 +405,7 @@ class OC_App { $installer->installApp($appId); $appManager = \OC::$server->getAppManager(); - if (!is_null($groups)) { + if ($groups !== []) { $groupManager = \OC::$server->getGroupManager(); $groupsList = []; foreach ($groups as $group) { diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index 4014664481a..edcccf9b0b9 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -34,7 +34,7 @@ if ($lastConfirm < (time() - 30 * 60 + 15)) { // allow 15 seconds delay exit(); } -$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : null; +$groups = isset($_POST['groups']) ? (array)$_POST['groups'] : []; $appIds = isset($_POST['appIds']) ? (array)$_POST['appIds'] : []; try { |