Bug 23376: <form action="foo.cgi?bar=baz" method="get"> should no longer result in two ?'s r=harishd

This commit is contained in:
pollmann%netscape.com 2000-01-11 07:34:12 +00:00
Родитель 6386c5da71
Коммит fd76569535
1 изменённых файлов: 6 добавлений и 7 удалений

Просмотреть файл

@ -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);