aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-10-23 12:57:29 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-10-23 15:05:23 +0000
commit35a1d4b224124878a4ded4d88ef32df48b315c87 (patch)
tree814eaeafbcd74ff30a9b404422222f69cbfe8b07 /apps
parent0fef593f7b443140869a5234f12364d3b8e5aaf9 (diff)
downloadnextcloud-server-35a1d4b224124878a4ded4d88ef32df48b315c87.tar.gz
nextcloud-server-35a1d4b224124878a4ded4d88ef32df48b315c87.zip
fix(app-store): Ensure the `groups` property is always an arraybackport/48853/stable30
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')
-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 ccd0b418040..9416381ff49 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -306,6 +306,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'];