[minor] [fix] get_routes_str

This commit is contained in:
Anand Doshi 2014-07-25 14:27:24 +05:30
parent 9f0c6103f2
commit b01a61e2e2

View file

@ -61,8 +61,14 @@ frappe.get_route_str = function(route) {
if(route.substr(0,1)=='#') route = route.substr(1);
if(route.substr(0,1)=='!') route = route.substr(1);
route = $.map(route.split('/'),
function(r) { return decodeURIComponent(r); }).join('/');
route = $.map(route.split('/'), function(r) {
try {
return decodeURIComponent(r);
} catch(e if e instanceof URIError) {
return r;
}
}).join('/');
return route;
}