mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-29 12:30:34 +00:00
parent
aac68bf2ba
commit
7e1f364177
2 changed files with 4 additions and 4 deletions
|
|
@ -859,8 +859,8 @@ function parseKeyValue(/**string*/keyValue) {
|
|||
forEach((keyValue || "").split('&'), function(keyValue){
|
||||
if (keyValue) {
|
||||
key_value = keyValue.split('=');
|
||||
key = unescape(key_value[0]);
|
||||
obj[key] = isDefined(key_value[1]) ? unescape(key_value[1]) : true;
|
||||
key = decodeURIComponent(key_value[0]);
|
||||
obj[key] = isDefined(key_value[1]) ? decodeURIComponent(key_value[1]) : true;
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
|
|
@ -869,7 +869,7 @@ function parseKeyValue(/**string*/keyValue) {
|
|||
function toKeyValue(obj) {
|
||||
var parts = [];
|
||||
forEach(obj, function(value, key) {
|
||||
parts.push(escape(key) + (value === true ? '' : '=' + escape(value)));
|
||||
parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));
|
||||
});
|
||||
return parts.length ? parts.join('&') : '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ LocationUrl.prototype = LocationHashbangUrl.prototype = {
|
|||
if (paramValue === null) {
|
||||
delete this.$$search[search];
|
||||
} else {
|
||||
this.$$search[search] = escape(paramValue);
|
||||
this.$$search[search] = encodeUriQuery(paramValue);
|
||||
}
|
||||
} else {
|
||||
this.$$search = isString(search) ? parseKeyValue(search) : search;
|
||||
|
|
|
|||
Loading…
Reference in a new issue