Add LLWeb::curlEscape
Since curl 7.21.2 - (October 13 2010), curl_escape (a deprecated function that will be removed in the future) changed it's behavior and no longer escapes the characters '-', '.', '_' and '~'. The only reasonable solution for us is to stop using it and use our own version that mimics the old behavior. The only other alternative would be to rename every .xml file with escaped characters in their name upon installation, depending on the behavior of the installed libcurl (on standalone anyway). However, if you add to that in the future curl_escape has to be replaced with curl_easy_escape, which is far from easy to call as it requires a CURL to be passed for which LL invented a wrapper in libllmessage, but did hide that (Curl::Easy is only defined in a .cpp file), then we're better of just using our own function, which I named LLWeb::curlEscape.
This commit is contained in:
@@ -911,20 +911,11 @@ void LLPanelLogin::loadLoginPage()
|
||||
std::string version = llformat("%d.%d.%d (%d)",
|
||||
LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD);
|
||||
|
||||
char* curl_channel = curl_escape(LL_CHANNEL, 0);
|
||||
|
||||
char* curl_version = curl_escape(version.c_str(), 0);
|
||||
|
||||
oStr << "&channel=" << curl_channel;
|
||||
oStr << "&version=" << curl_version;
|
||||
|
||||
curl_free(curl_channel);
|
||||
curl_free(curl_version);
|
||||
oStr << "&channel=" << LLWeb::curlEscape(LL_CHANNEL);
|
||||
oStr << "&version=" << LLWeb::curlEscape(version);
|
||||
|
||||
// Grid
|
||||
char* curl_grid = curl_escape(LLViewerLogin::getInstance()->getGridLabel().c_str(), 0);
|
||||
oStr << "&grid=" << curl_grid;
|
||||
curl_free(curl_grid);
|
||||
oStr << "&grid=" << LLWeb::curlEscape(LLViewerLogin::getInstance()->getGridLabel());
|
||||
|
||||
if (gHippoGridManager->getConnectedGrid()->isSecondLife()) {
|
||||
// find second life grid from login URI
|
||||
@@ -938,9 +929,7 @@ void LLPanelLogin::loadLoginPage()
|
||||
i = tmp.rfind('/');
|
||||
if (i != std::string::npos) {
|
||||
tmp = tmp.substr(i+1);
|
||||
char* curl_grid = curl_escape(tmp.c_str(), 0);
|
||||
oStr << "&grid=" << curl_grid;
|
||||
curl_free(curl_grid);
|
||||
oStr << "&grid=" << LLWeb::curlEscape(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -997,13 +986,11 @@ void LLPanelLogin::loadLoginPage()
|
||||
lastname = gSavedSettings.getString("LastName");
|
||||
}
|
||||
|
||||
char* curl_region = curl_escape(region.c_str(), 0);
|
||||
std::string curl_region = LLWeb::curlEscape(region);
|
||||
|
||||
oStr <<"firstname=" << firstname <<
|
||||
"&lastname=" << lastname << "&location=" << location << "®ion=" << curl_region;
|
||||
|
||||
curl_free(curl_region);
|
||||
|
||||
if (!password.empty())
|
||||
{
|
||||
oStr << "&password=" << password;
|
||||
|
||||
Reference in New Issue
Block a user