File tree Expand file tree Collapse file tree
apps/theming/lib/Listener Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,12 +79,16 @@ private function handleCoreValues(BeforePreferenceSetEvent|BeforePreferenceDelet
7979 }
8080
8181 $ value = json_decode ($ event ->getConfigValue (), true , flags:JSON_THROW_ON_ERROR );
82- if (is_array (($ value ))) {
83- foreach ($ value as $ id => $ info ) {
84- if (!is_array ($ info ) || empty ($ info ) || !isset ($ info ['app ' ]) || !$ this ->appManager ->isEnabledForUser ($ info ['app ' ]) || !is_numeric ($ info ['order ' ] ?? '' )) {
85- // Invalid config value, refuse the change
86- return ;
87- }
82+ if (!is_array (($ value ))) {
83+ // Must be an array
84+ return ;
85+ }
86+
87+ foreach ($ value as $ id => $ info ) {
88+ // required format: [ navigation_id: string => [ order: int, app?: string ] ]
89+ if (!is_string ($ id ) || !is_array ($ info ) || empty ($ info ) || !isset ($ info ['order ' ]) || !is_numeric ($ info ['order ' ]) || (isset ($ info ['app ' ]) && !$ this ->appManager ->isEnabledForUser ($ info ['app ' ]))) {
90+ // Invalid config value, refuse the change
91+ return ;
8892 }
8993 }
9094 $ event ->setValid (true );
You can’t perform that action at this time.
0 commit comments