mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 07:13:23 -04:00
fix(app-store): Ensure the groups property is always an array
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>
This commit is contained in:
parent
0fef593f7b
commit
35a1d4b224
1 changed files with 4 additions and 0 deletions
|
|
@ -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'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue