Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for 'cannot switch back to default language'-bug

orbiterbe18b5d8cd85
diff --git a/htroot/ConfigLanguage_p.java b/htroot/ConfigLanguage_p.java
index 6cc61add8..ac9bc3f1c 100644
--- a/htroot/ConfigLanguage_p.java
+++ b/htroot/ConfigLanguage_p.java
@@ -83,7 +83,7 @@ public class ConfigLanguage_p {
* read from the language directory. This is very important to prevent
* directory traversal attacks!
*/
- if (langFiles.contains(selectedLanguage)) {
+ if (langFiles.contains(selectedLanguage) || selectedLanguage.startsWith("default")) {
translator.changeLang(env, langPath, selectedLanguage);
}
diff --git a/source/de/anomic/data/translator.java b/source/de/anomic/data/translator.java
index 8eddc6aa0..36cb3e7fd 100644
--- a/source/de/anomic/data/translator.java
+++ b/source/de/anomic/data/translator.java
@@ -226,7 +226,7 @@ public class translator {
final HashMap<String, String> map = new HashMap<String, String>();
int p;
for (int i = 0; i < ms.length; i++) {
- p = ms[i].indexOf("/");
+ p = ms[i].indexOf('/');
if (p > 0)
map.put(ms[i].substring(0, p), ms[i].substring(p + 1));
}