File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
identity-apps-core/apps/authentication-portal/src/main/webapp/includes Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 132132 // Ignore comments and empty lines
133133 if (! line .trim ().startsWith (" #" ) && ! line .trim ().isEmpty ()) {
134134 // Split the line into key and value using '=' as the delimiter
135- String [] keyValue = line .split (" =" );
135+ String [] keyValue = line .split (" =" , 2 );
136+ if (keyValue .length < 2 ) {
137+ continue ; // Skip malformed lines
138+ }
136139 // Split the key further using '.' as the delimiter
137140 String [] parts = keyValue[0 ].split (" \\ ." );
141+ if (parts .length == 0 ) {
142+ continue ;
143+ }
138144 String languageCode = parts[parts .length - 1 ];
139145 // Split the value further using ',' as the delimiter
140146 String [] values = keyValue[1 ].split (" ," );
147+ if (values .length < 2 ) {
148+ continue ; // Skip lines without proper country,displayName format
149+ }
141150 String country = values[0 ];
142- String displayName = values[1 ];
151+ // displayName is available in values[1] if needed in the future
143152 // Add the values to the list.
144153 supportedLanguages .put (languageCode, country);
145154 if (! languageSupportedCountries .contains (country)) {
You can’t perform that action at this time.
0 commit comments