Traktopel
28 Jun 2010, 12:18 AM
Ext version tested:
Ext 3.2.2
Adapter used:
ext
Browser versions tested against:
FF3 (firebug 1.5.3 installed)
Operating System:
Win 7
Description:
If a token in your url contains more thant one equal symbol ... (ie : url?...&code=YWR=taW4) the string will not take account on what characters are behind the second equal
Test Case:
var urlArgsDecoded = Ext.urlDecode("http://localhost/index.html?code=YWR=taW4");
Possible fix:
urlDecode : function(string, overwrite){
if(Ext.isEmpty(string)){
return {};
}
var obj = {},
pairs = string.split('&'),
d = decodeURIComponent,
name,
value;
Ext.each(pairs, function(pair) {
pair = pair.split('=');
name = d(pair[0]);
pair.remove(pair[0]);
value = d(pair.join('='));
//value = d(pair[1]);
obj[name] = overwrite || !obj[name] ? value :
[].concat(obj[name]).concat(value);
});
return obj;
},
Ext 3.2.2
Adapter used:
ext
Browser versions tested against:
FF3 (firebug 1.5.3 installed)
Operating System:
Win 7
Description:
If a token in your url contains more thant one equal symbol ... (ie : url?...&code=YWR=taW4) the string will not take account on what characters are behind the second equal
Test Case:
var urlArgsDecoded = Ext.urlDecode("http://localhost/index.html?code=YWR=taW4");
Possible fix:
urlDecode : function(string, overwrite){
if(Ext.isEmpty(string)){
return {};
}
var obj = {},
pairs = string.split('&'),
d = decodeURIComponent,
name,
value;
Ext.each(pairs, function(pair) {
pair = pair.split('=');
name = d(pair[0]);
pair.remove(pair[0]);
value = d(pair.join('='));
//value = d(pair[1]);
obj[name] = overwrite || !obj[name] ? value :
[].concat(obj[name]).concat(value);
});
return obj;
},