diff --git a/code/nel/include/nel/gui/group_html.h b/code/nel/include/nel/gui/group_html.h index 635136220..aecf5f855 100644 --- a/code/nel/include/nel/gui/group_html.h +++ b/code/nel/include/nel/gui/group_html.h @@ -39,7 +39,6 @@ namespace NLGUI class CGroupParagraph; extern std::string CurrentCookie; - extern std::string HTTPCurrentDomain; // HTML group /** @@ -376,6 +375,7 @@ namespace NLGUI std::string _URL; // Current URL std::string _DocumentUrl; + std::string _DocumentDomain; // Valid base href was found bool _IgnoreBaseUrlTag; // Fragment from loading url diff --git a/code/nel/include/nel/gui/url_parser.h b/code/nel/include/nel/gui/url_parser.h index 915d7d85a..758f1d340 100644 --- a/code/nel/include/nel/gui/url_parser.h +++ b/code/nel/include/nel/gui/url_parser.h @@ -52,6 +52,7 @@ namespace NLGUI public: std::string scheme; std::string authority; + std::string host; std::string path; std::string query; std::string hash; diff --git a/code/nel/src/gui/group_html.cpp b/code/nel/src/gui/group_html.cpp index 30dd3ec3f..18aa3e1eb 100644 --- a/code/nel/src/gui/group_html.cpp +++ b/code/nel/src/gui/group_html.cpp @@ -506,7 +506,7 @@ namespace NLGUI } else { - receiveCookies(_CurlWWW->Request, HTTPCurrentDomain, _TrustedDomain); + receiveCookies(_CurlWWW->Request, _DocumentDomain, _TrustedDomain); // redirect, get the location and try browse again // we cant use curl redirection because 'addHTTPGetParams()' must be called on new destination @@ -533,7 +533,7 @@ namespace NLGUI } else { - receiveCookies(_CurlWWW->Request, HTTPCurrentDomain, _TrustedDomain); + receiveCookies(_CurlWWW->Request, _DocumentDomain, _TrustedDomain); _RedirectsRemaining = DEFAULT_RYZOM_REDIRECT_LIMIT; @@ -2548,6 +2548,7 @@ namespace NLGUI _SelectOption = false; _GroupListAdaptor = NULL; _DocumentUrl = ""; + _DocumentDomain = ""; _UrlFragment.clear(); _RefreshUrl.clear(); _NextRefreshTime = 0.0; @@ -4657,9 +4658,12 @@ namespace NLGUI string finalUrl; bool isLocal = lookupLocalFile (finalUrl, _URL.c_str(), true); - // Save new url _URL = finalUrl; + CUrlParser uri (_URL); + _TrustedDomain = isTrustedDomain(uri.host); + _DocumentDomain = uri.host; + // file is probably from bnp (ingame help) if (isLocal) { @@ -4667,8 +4671,6 @@ namespace NLGUI } else { - _TrustedDomain = isTrustedDomain(setCurrentDomain(finalUrl)); - SFormFields formfields; if (_PostNextTime) { @@ -4704,9 +4706,11 @@ namespace NLGUI // Ref the form CForm &form = _Forms[_PostFormId]; - // Save new url _URL = form.Action; - _TrustedDomain = isTrustedDomain(setCurrentDomain(_URL)); + + CUrlParser uri(_URL); + _TrustedDomain = isTrustedDomain(uri.host); + _DocumentDomain = uri.host; for (i=0; i