aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-10-23 12:57:29 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2024-10-23 13:32:36 +0200
commit9955b135642a805ff5fc3ec91ba1d969b7385c5e (patch)
tree8ba9e070cc8c84e00908569be7f1ca164f0edb75 /apps/settings
parent74cd6e295a8e2e7c64e4fe38ba775986c57509a4 (diff)
downloadnextcloud-server-9955b135642a805ff5fc3ec91ba1d969b7385c5e.tar.gz
nextcloud-server-9955b135642a805ff5fc3ec91ba1d969b7385c5e.zip
fix(app-store): Ensure the `groups` property is always an arrayfix/app-store-groups
If the value was a string, like a single group, then `json_decode` will also yield only a string. So in this case we ensure the property is always an array with that value. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Controller/AppSettingsController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index 7a1e5dd7157..b70978a3b92 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -307,6 +307,10 @@ class AppSettingsController extends Controller {
$groups = [];
if (is_string($appData['groups'])) {
$groups = json_decode($appData['groups']);
+ // ensure 'groups' is an array
+ if (!is_array($groups)) {
+ $groups = [$groups];
+ }
}
$appData['groups'] = $groups;
$appData['canUnInstall'] = !$appData['active'] && $appData['removable'];