Bug 279035: canonizeUrl() ignores appended directories. Patch by pkasting@google.com, r+a181=mconnor
git-svn-id: svn://10.0.0.236/trunk@200073 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2311,8 +2311,14 @@ function canonizeUrl(aTriggeringEvent, aPostDataRef)
|
||||
// trim leading/trailing spaces (bug 233205)
|
||||
url = url.replace( /^\s+/, "");
|
||||
url = url.replace( /\s+$/, "");
|
||||
// Tack www. and suffix on.
|
||||
url = "http://www." + url + suffix;
|
||||
// Tack www. and suffix on. If user has appended directories, insert
|
||||
// suffix before them (bug 279035). Be careful not to get two slashes.
|
||||
var firstSlash = url.indexOf("/");
|
||||
if (firstSlash >= 0)
|
||||
url = "http://www." + url.substring(0, firstSlash) + suffix +
|
||||
url.substring(firstSlash + 1, url.length);
|
||||
else
|
||||
url = "http://www." + url + suffix;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user