From 3e0d637b200ce982b00583a90b5a07164a779064 Mon Sep 17 00:00:00 2001 From: "andreas.otte%primus-online.de" Date: Wed, 15 Aug 2001 22:29:10 +0000 Subject: [PATCH] fix bug 90439 [relative queries from cgi broken] revert to pre 0.9.2 behaviour when handling relative query urls. r=bbaetz sr=darin fix bug 94849 [Wrong handling of empty relative urls] implement RFC 2396 conforming handling of empty relative urls. r=bbaetz sr=dougt fix bug 87298 [page context not displayed] remove tabs (\t) from inside absolute urls in case someone "formats" urls. r=dougt sr=darin --- netwerk/base/src/nsStdURL.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/netwerk/base/src/nsStdURL.cpp b/netwerk/base/src/nsStdURL.cpp index 3280b5ac5461..c375683a68d2 100644 --- a/netwerk/base/src/nsStdURL.cpp +++ b/netwerk/base/src/nsStdURL.cpp @@ -888,7 +888,21 @@ nsStdURL::Resolve(const char *relativePath, char **result) case '/': finalSpec += (char*)start; break; + case '?': + rv = AppendString(finalSpec,mDirectory,ESCAPED, + nsIIOService::url_Directory); + rv = AppendFileName(finalSpec,mFileBaseName,mFileExtension, + ESCAPED); + if (mParam) + { + finalSpec += ';'; + rv = AppendString(finalSpec,mParam,ESCAPED, + nsIIOService::url_Param); + } + finalSpec += (char*)start; + break; case '#': + case '\0': rv = AppendString(finalSpec,mDirectory,ESCAPED, nsIIOService::url_Directory); rv = AppendFileName(finalSpec,mFileBaseName,mFileExtension, @@ -997,14 +1011,14 @@ nsStdURL::SetSpec(const char* i_Spec) while (fwdPtr && (*fwdPtr > '\0') && (*fwdPtr <= ' ')) fwdPtr++; - // Strip linebreaks + // Strip linebreaks and tabs char* copyToPtr = 0; char* midPtr = fwdPtr; while (midPtr && (*midPtr != '\0')) { - while ((*midPtr == '\r') || (*midPtr == '\n')) { // if linebreak + while ((*midPtr == '\r') || (*midPtr == '\n') || (*midPtr == '\t')) { // if linebreak or tab if (!copyToPtr) copyToPtr = midPtr; // start copying - midPtr++; // skip linebreak + midPtr++; // skip linebreak and tab } if (copyToPtr) { // if copying *copyToPtr = *midPtr; @@ -1012,7 +1026,7 @@ nsStdURL::SetSpec(const char* i_Spec) } midPtr++; } - if (copyToPtr) { // If we removed linebreaks, copyToPtr is the end of the string + if (copyToPtr) { // If we removed linebreaks or tabs, copyToPtr is the end of the string midPtr = copyToPtr; }