Merge "Fix encoding/decoding of dashboard ids (one more time)"

This commit is contained in:
Shawn Pearce
2012-12-19 21:21:48 -08:00
committed by Gerrit Code Review
2 changed files with 5 additions and 5 deletions

View File

@@ -434,8 +434,8 @@ public class Dispatcher {
}
c = dashboardId.indexOf(":");
if (0 <= c) {
final String ref = URL.decode(dashboardId.substring(0, c));
final String path = URL.decode(dashboardId.substring(c + 1));
final String ref = URL.decodeQueryString(dashboardId.substring(0, c));
final String path = URL.decodeQueryString(dashboardId.substring(c + 1));
DashboardList.get(new Project.NameKey(project), ref + ":" + path, cb);
return;
}

View File

@@ -50,11 +50,11 @@ public class DashboardList extends NativeList<DashboardInfo> {
private static String encodeDashboardId(String dashboardId) {
int c = dashboardId.indexOf(":");
if (0 <= c) {
final String ref = URL.encode(dashboardId.substring(0, c));
final String path = URL.encode(dashboardId.substring(c + 1));
final String ref = URL.encodeQueryString(dashboardId.substring(0, c));
final String path = URL.encodeQueryString(dashboardId.substring(c + 1));
return ref + ":" + path;
} else {
return URL.encode(dashboardId);
return URL.encodeQueryString(dashboardId);
}
}