- MGR: Fix the case where user visits Grid Republic with IE 7 and

has a space character in their username.  IE6 and below kept
        the space as part of the filename, IE7 and above replace the
        space with an underscore.
        
    clientgui/
        browser.cpp

svn path=/trunk/boinc/; revision=18450
This commit is contained in:
Rom Walton 2009-06-18 21:49:28 +00:00
parent 4d4abc1983
commit 904bb14490
2 changed files with 26 additions and 1 deletions

View File

@ -5795,3 +5795,12 @@ Rom 18 June 2009
clientgui/
browser.cpp
Rom 18 June 2009
- MGR: Fix the case where user visits Grid Republic with IE 7 and
has a space character in their username. IE6 and below kept
the space as part of the filename, IE7 and above replace the
space with an underscore.
clientgui/
browser.cpp

View File

@ -836,7 +836,7 @@ bool find_site_cookie_ie(
// undocumented.
//
bool detect_cookie_ie_unsupported(std::string& project_url, std::string& name, std::string& value) {
char buf[512];
char buf[512], buf2[512];
int i;
std::string cookie_path;
std::string username;
@ -846,6 +846,7 @@ bool detect_cookie_ie_unsupported(std::string& project_url, std::string& name, s
// Initialize variables
i = 0;
strcpy(buf, "");
strcpy(buf2, "");
// Determine which path to look for the cookie files in
get_internet_explorer_cookie_path(true, cookie_path);
@ -869,11 +870,20 @@ bool detect_cookie_ie_unsupported(std::string& project_url, std::string& name, s
//
// Construct the host cookie file name
//
// Original naming scheme
snprintf(buf, sizeof(buf), "%s%s@%s[%d].txt", cookie_path.c_str(), username.c_str(), hostname.c_str(), i);
if (find_site_cookie_ie((char*)&buf, hostname, name, value)) {
break;
}
// IE 7.x or better
string_substitute(buf, buf2, sizeof(buf2), " ", "_");
if (find_site_cookie_ie((char*)&buf2, hostname, name, value)) {
break;
}
//
// Construct the domainname cookie file name
//
@ -881,6 +891,12 @@ bool detect_cookie_ie_unsupported(std::string& project_url, std::string& name, s
if (find_site_cookie_ie((char*)&buf, domainname, name, value)) {
break;
}
// IE 7.x or better
string_substitute(buf, buf2, sizeof(buf2), " ", "_");
if (find_site_cookie_ie((char*)&buf2, domainname, name, value)) {
break;
}
}
if (!name.empty() && !value.empty()) {