Fix the combineUrl function
* Allow a url to omit the protocol and use the same protocol as the * current page
This commit is contained in:
parent
cab5d7b96f
commit
220a8e4f0e
@ -228,7 +228,11 @@ function combineUrl(baseUrl, url) {
|
||||
if (url.charAt(0) == '/') {
|
||||
// absolute path
|
||||
var i = baseUrl.indexOf('://');
|
||||
i = baseUrl.indexOf('/', i + 3);
|
||||
if (url.charAt(1) === '/') {
|
||||
++i;
|
||||
} else {
|
||||
i = baseUrl.indexOf('/', i + 3);
|
||||
}
|
||||
return baseUrl.substring(0, i) + url;
|
||||
} else {
|
||||
// relative path
|
||||
|
Loading…
Reference in New Issue
Block a user