aboutsummaryrefslogtreecommitdiffstats
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:02:06 +0200
commitd9304d3a14f42f4ea01d9c783ef628b8656230e4 (patch)
tree986171401787de98177a53d16f86686c34eabfda
parentea5b1b9591e976fe78558898ee05be76d25471e9 (diff)
downloadnextcloud-server-refactor/appstore-modernization.tar.gz
nextcloud-server-refactor/appstore-modernization.zip
fix(app-store): Ensure the `groups` property is always an arrayrefactor/appstore-modernization
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>
-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 f50338c3923..b227d815597 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -317,6 +317,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;