From 28bbf76c8f3285ec3247d9855fad39723c20790c Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 11 Nov 2015 16:40:42 +0100 Subject: [PATCH] Fixed: Bug with language in URLs --HG-- branch : compatibility-develop --- code/ryzom/client/src/login.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/ryzom/client/src/login.cpp b/code/ryzom/client/src/login.cpp index 4d56a67a7..153b7ba6a 100644 --- a/code/ryzom/client/src/login.cpp +++ b/code/ryzom/client/src/login.cpp @@ -1916,19 +1916,23 @@ class CAHOpenURL : public IActionHandler string::size_type pos_lang = url.find("/en/"); // or new forums - if (pos_lang != string::npos) + if (pos_lang == string::npos) pos_lang = url.find("=en#"); - if (pos_lang == string::npos) + if (pos_lang != string::npos) + { url.replace(pos_lang + 1, 2, ClientCfg.getHtmlLanguageCode()); - - // append language - if (url.find('?') != string::npos) - url += "&"; + } else - url += "?"; + { + // append language + if (url.find('?') != string::npos) + url += "&"; + else + url += "?"; - url += "language=" + ClientCfg.LanguageCode; + url += "language=" + ClientCfg.LanguageCode; + } openURL(url.c_str());