mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Fixing rtm++ bug 56529. Necko was unescaping the content of URL's if a segment of the URL is requested (but not if the whole URL is requested), the DOM code used this unescaped string as is and that caused backwards compatibility problems. a=gagan&brendan, r=andreas.otte@primus-online.de
This commit is contained in:
parent
8911ee3487
commit
c1ccea8268
@ -567,7 +567,7 @@ nsHTMLAnchorElement::GetSearch(nsAWritableString& aSearch)
|
||||
nsIURL* url;
|
||||
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = url->GetQuery(&search);
|
||||
result = url->GetEscapedQuery(&search);
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
|
@ -410,7 +410,7 @@ nsHTMLAreaElement::GetSearch(nsAWritableString& aSearch)
|
||||
nsIURL* url;
|
||||
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = url->GetQuery(&search);
|
||||
result = url->GetEscapedQuery(&search);
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
|
@ -569,7 +569,7 @@ LocationImpl::GetSearch(nsAWritableString& aSearch)
|
||||
nsIURL* url;
|
||||
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = url->GetQuery(&search);
|
||||
result = url->GetEscapedQuery(&search);
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
|
@ -567,7 +567,7 @@ nsHTMLAnchorElement::GetSearch(nsAWritableString& aSearch)
|
||||
nsIURL* url;
|
||||
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = url->GetQuery(&search);
|
||||
result = url->GetEscapedQuery(&search);
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
|
@ -410,7 +410,7 @@ nsHTMLAreaElement::GetSearch(nsAWritableString& aSearch)
|
||||
nsIURL* url;
|
||||
result = uri->QueryInterface(NS_GET_IID(nsIURL), (void**)&url);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
result = url->GetQuery(&search);
|
||||
result = url->GetEscapedQuery(&search);
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
if (result == NS_OK && (nsnull != search) && ('\0' != *search)) {
|
||||
|
@ -546,6 +546,11 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetQuery(char * *aQuery)
|
||||
return m_baseURL->GetQuery(aQuery);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMailNewsUrl::GetEscapedQuery(char * *aQuery)
|
||||
{
|
||||
return m_baseURL->GetEscapedQuery(aQuery);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgMailNewsUrl::SetQuery(const char *aQuery)
|
||||
{
|
||||
return m_baseURL->SetQuery(aQuery);
|
||||
|
@ -112,6 +112,13 @@ interface nsIURL : nsIURI
|
||||
* If a file extension does not exist, the empty string is returned.
|
||||
*/
|
||||
attribute string fileExtension;
|
||||
|
||||
/**
|
||||
* Returns the query portion (the part after the "?") of the URL
|
||||
* without unescaping the string.
|
||||
* If there isn't one, an empty string is returned.
|
||||
*/
|
||||
readonly attribute string escapedQuery;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -168,6 +168,12 @@ nsStdURL::GetQuery(char* *o_Query)
|
||||
return GetString(o_Query, mQuery, UNESCAPED);
|
||||
}
|
||||
|
||||
inline NS_METHOD
|
||||
nsStdURL::GetEscapedQuery(char* *o_Query)
|
||||
{
|
||||
return GetString(o_Query, mQuery, ESCAPED);
|
||||
}
|
||||
|
||||
inline NS_METHOD
|
||||
nsStdURL::GetRef(char* *o_Ref)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user