#106492Preview Simulator sets fe_user usergroup with wrong type
Description
A third party extension uses this line to get the list of direct usergroup uids of the current fe user.
```
declare(strict_types=1);
…
explode(‘,’, $GLOBALS[‘TSFE’]->fe_user->user[‘usergroup’] ?? ‘’);
```
If the usergroup is simulated via query parameter `?ADMCMD_simUser=2`, the preview simulator sets the usergroup as an int (not as string (csv)). Therefore explode gets an int as the second argument, but expects a string.
I am aware this can be fixed with a type cast but I think for most developers it is reasonable to assume that `user[‘usergroup’]` contains a string.
Reviews 2
History 37
-
Gerrit Code Review pushed patch set 1 for main to change 88911 status
NewUnder Review <span data-processor="relativetime" data-value="2025-04-02T10:58:21+00:00" > 04/02/25, 10:58 </span> -
Gerrit Code Review pushed patch set 2 for main to change 88911 <span data-processor="relativetime" data-value="2025-04-02T11:34:31+00:00" > 04/02/25, 11:34 </span>
-
Hannes Lau changed description <span data-processor="relativetime" data-value="2025-04-02T11:37:30+00:00" > 04/02/25, 11:37 </span>
-
Gerrit Code Review pushed patch set 3 for main to change 88911 <span data-processor="relativetime" data-value="2025-04-02T16:23:44+00:00" > 04/02/25, 16:23 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 88922 <span data-processor="relativetime" data-value="2025-04-02T16:55:31+00:00" > 04/02/25, 16:55 </span>
-
Hannes Lau commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-04-02T17:10:08+00:00" > 04/02/25, 17:10 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:22:01+00:00" > 12/02/25, 14:22 </span>
Applied in changeset commit:fcd5e080f9fc047acc09c15db163ae3c845f719c.