mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-21 18:42:31 +08:00
fix(ngRoute): remove unnecessary call to decodeURIComponent
Since `$location.$$path` is already decoded, doing an extra `decodeURIComponent` is both unnecessary and can cause problems. Specifically, if the path originally includes an encoded `%` (aka `%25`), then ngRoute will throw "URIError: URI malformed". Closes #6326 Closes #6327
This commit is contained in:
committed by
Peter Bacon Darwin
parent
49b2a1c8cf
commit
1b779028fd
@@ -468,9 +468,7 @@ function $RouteProvider(){
|
||||
for (var i = 1, len = m.length; i < len; ++i) {
|
||||
var key = keys[i - 1];
|
||||
|
||||
var val = 'string' == typeof m[i]
|
||||
? decodeURIComponent(m[i])
|
||||
: m[i];
|
||||
var val = m[i];
|
||||
|
||||
if (key && val) {
|
||||
params[key.name] = val;
|
||||
|
||||
Reference in New Issue
Block a user