diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-10-23 12:57:29 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-10-23 13:02:06 +0200 |
commit | d9304d3a14f42f4ea01d9c783ef628b8656230e4 (patch) | |
tree | 986171401787de98177a53d16f86686c34eabfda | |
parent | ea5b1b9591e976fe78558898ee05be76d25471e9 (diff) | |
download | nextcloud-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.php | 4 |
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; |