Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 2385bd1

Browse files
prevent double encoding
1 parent c3e7451 commit 2385bd1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

app/profile/profile.routes.js

-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ import angular from 'angular'
2525
controller: 'ProfileCtrl as profileVm',
2626
resolve: {
2727
userHandle: ['$stateParams', function($stateParams) {
28-
if (decodeURIComponent($stateParams.userHandle) !== $stateParams.userHandle) {
29-
return decodeURIComponent($stateParams.userHandle)
30-
}
3128
return $stateParams.userHandle
3229
}],
3330
profile: ['userHandle', 'ProfileService', function(userHandle, ProfileService) {

app/topcoder.routes.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ import moment from 'moment'
2828
if (path.indexOf('?') > -1) {
2929
return path.replace('?', '/?')
3030
}
31-
$location.replace().path(path + '/')
31+
// prevent double encoding
32+
path = path.split('/')
33+
for (var i = 0; i < path.length; i++) {
34+
while (decodeURIComponent(path[i]) !== path[i]) {
35+
path[i] = decodeURIComponent(path[i])
36+
}
37+
}
38+
$location.replace().path(path.join('/') + '/')
3239
})
3340

3441
var states = {

0 commit comments

Comments
 (0)