File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/CoreBundle/Controller Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -479,12 +479,15 @@ public function getUserProfile(
479
479
): JsonResponse {
480
480
$ user = $ userRepository ->find ($ userId );
481
481
if (!$ user ) {
482
- return $ this ->createNotFoundException ('User not found ' );
482
+ throw $ this ->createNotFoundException ('User not found ' );
483
483
}
484
484
485
485
$ baseUrl = $ requestStack ->getCurrentRequest ()->getBaseUrl ();
486
486
$ profileFieldsVisibilityJson = $ settingsManager ->getSetting ('profile.profile_fields_visibility ' );
487
- $ profileFieldsVisibility = json_decode ($ profileFieldsVisibilityJson , true )['options ' ] ?? [];
487
+ $ decoded = json_decode ($ profileFieldsVisibilityJson , true );
488
+ $ profileFieldsVisibility = (is_array ($ decoded ) && isset ($ decoded ['options ' ]))
489
+ ? $ decoded ['options ' ]
490
+ : [];
488
491
489
492
$ vCardUserLink = $ profileFieldsVisibility ['vcard ' ] ?? true ? $ baseUrl .'/main/social/vcard_export.php?userId= ' .(int ) $ userId : '' ;
490
493
@@ -529,7 +532,10 @@ private function getExtraFieldBlock(
529
532
}
530
533
531
534
$ fieldVisibilityConfig = $ settingsManager ->getSetting ('profile.profile_fields_visibility ' );
532
- $ fieldVisibility = ($ fieldVisibilityConfig && 'false ' !== $ fieldVisibilityConfig ) ? json_decode ($ fieldVisibilityConfig , true )['options ' ] : [];
535
+ $ decoded = json_decode ($ fieldVisibilityConfig , true );
536
+ $ fieldVisibility = (is_array ($ decoded ) && isset ($ decoded ['options ' ]))
537
+ ? $ decoded ['options ' ]
538
+ : [];
533
539
534
540
$ extraUserData = $ userRepository ->getExtraUserData ($ userId );
535
541
$ extraFieldsFormatted = [];
You can’t perform that action at this time.
0 commit comments