squeeze extra slashes in url()

This commit is contained in:
cloudhead
2010-07-25 16:44:27 -04:00
parent 326e863bbc
commit 334f224d7e

View File

@@ -2,10 +2,8 @@
tree.URL = function (val, paths) {
// Add the base path if the URL is relative and we are in the browser
if (!/^(?:http:\/)?\//.test(val.value) &&
paths.length > 0 &&
typeof(window) !== 'undefined') {
val.value = [paths[0], val.value].join('/');
if (!/^(?:http:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
val.value = [paths[0], val.value].join('/').replace('//', '/');
}
this.value = val;
};