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

Commit 989654c

Browse files
committedJul 10, 2017
Winner: Fix the issue with URLs of the member profile page
Submission 518068 by thomaskranitsas to this challenge: http://www.topcoder.com/challenge-details/30058321/?type=develop
1 parent 0685476 commit 989654c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
 

‎app/topcoder.routes.js

+9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,15 @@ import moment from 'moment'
2121
$urlRouterProvider.rule(function($injector) {
2222
var $location = $injector.get('$location')
2323
var path = $location.url()
24+
// Remove double URL encoding from member handle
25+
var pathArray = path.split('/')
26+
var membersIndex = pathArray.indexOf('members')
27+
if (membersIndex > -1) {
28+
while (decodeURIComponent(pathArray[membersIndex + 1]) !== pathArray[membersIndex + 1]) {
29+
pathArray[membersIndex + 1] = decodeURIComponent(pathArray[membersIndex + 1])
30+
}
31+
path = pathArray.join('/')
32+
}
2433
// check to see if the path already has a slash where it should be
2534
if (path[path.length - 1] === '/' || path.indexOf('/?') > -1 || path.indexOf('/#') > -1) {
2635
return

0 commit comments

Comments
 (0)
This repository has been archived.