Fix for "extra '?' is added to the URL by the LoadURL method", review and final patch from tschaub (closes #1616)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7984 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -87,7 +87,11 @@ OpenLayers.Request = {
|
||||
var request = new OpenLayers.Request.XMLHttpRequest();
|
||||
var url = config.url;
|
||||
if(config.params) {
|
||||
url += "?" + OpenLayers.Util.getParameterString(config.params);
|
||||
var paramString = OpenLayers.Util.getParameterString(config.params);
|
||||
if(paramString.length > 0) {
|
||||
var separator = (url.indexOf('?') > -1) ? '&' : '?';
|
||||
url += separator + paramString;
|
||||
}
|
||||
}
|
||||
if(config.proxy && (url.indexOf("http") == 0)) {
|
||||
url = config.proxy + encodeURIComponent(url);
|
||||
@@ -265,4 +269,4 @@ OpenLayers.Request = {
|
||||
return OpenLayers.Request.issue(config);
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user