зеркало из https://github.com/mozilla/gecko-dev.git
Bug 23376: <form action="foo.cgi?bar=baz" method="get"> should no longer result in two ?'s r=harishd
This commit is contained in:
Родитель
6386c5da71
Коммит
fd76569535
|
@ -627,15 +627,14 @@ nsFormFrame::OnSubmit(nsIPresContext* aPresContext, nsIFrame* aFrame)
|
|||
GetTarget(&target);
|
||||
|
||||
if (!isPost) {
|
||||
if (href.Last() == '?') {
|
||||
// Already specifies a '?' in the href so don't add another one
|
||||
href.Append(data);
|
||||
}
|
||||
else {
|
||||
// Doesn't have a ? in the href so add one
|
||||
if (href.FindChar('?', PR_FALSE, 0) == kNotFound) { // Add a ? if needed
|
||||
href.Append('?');
|
||||
href.Append(data);
|
||||
} else { // Adding to existing query string
|
||||
if (href.Last() != '&' && href.Last() != '?') { // Add a & if needed
|
||||
href.Append('&');
|
||||
}
|
||||
}
|
||||
href.Append(data);
|
||||
}
|
||||
nsAutoString absURLSpec;
|
||||
result = NS_MakeAbsoluteURI(href, docURL, absURLSpec);
|
||||
|
|
Загрузка…
Ссылка в новой задаче