fix for urls with same host in createUrlObject in IE. r=tschaub (pullup

#2060)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9320 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-04-27 20:57:14 +00:00
parent 0811578965
commit 51b1937aa6
2 changed files with 11 additions and 4 deletions

View File

@@ -1356,7 +1356,10 @@ OpenLayers.Util.createUrlObject = function(url, options) {
a.href = url;
//host (without port)
urlObject.host = a.host;
// if we don't have a host (which is the case with URLs starting with "/"
// in IE), take the window location's host to match other browsers that
// fill in the window's location host automatically
urlObject.host = a.host || window.location.host;
var port = a.port;
if (port.length <= 0) {
var newHostLength = urlObject.host.length - (port.length);
@@ -1380,7 +1383,6 @@ OpenLayers.Util.createUrlObject = function(url, options) {
}
urlObject.args = OpenLayers.Util.getParameters(queryString);
//pathname (this part allows for relative <-> absolute comparison)
if ( ((urlObject.protocol == "file:") && (url.indexOf("file:") != -1)) ||
((urlObject.protocol != "file:") && (urlObject.host != "")) ) {