- Timestamp:
- 2012-02-20T22:08:03+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r4883 r5008 21 21 */ 22 22 public abstract class RequestHandler { 23 23 24 24 public static final String globalConfirmationKey = "remotecontrol.always-confirm"; 25 25 public static final boolean globalConfirmationDefault = false; … … 155 155 */ 156 156 protected void parseArgs() { 157 StringTokenizer st = new StringTokenizer(this.request, "&?");158 157 HashMap<String, String> args = new HashMap<String, String>(); 159 // ignore first token which is the command 160 if(st.hasMoreTokens()) st.nextToken(); 161 while (st.hasMoreTokens()) { 162 String param = st.nextToken(); 163 int eq = param.indexOf("="); 164 if (eq > -1) 165 args.put(param.substring(0, eq), 166 param.substring(eq + 1)); 158 if (this.request.indexOf('?') != -1) { 159 String query = this.request.substring(this.request.indexOf('?') + 1); 160 if (query.indexOf('#') != -1) { 161 query = query.substring(0, query.indexOf('#')); 162 } 163 String[] params = query.split("&", -1); 164 for (String param : params) { 165 int eq = param.indexOf('='); 166 if (eq != -1) { 167 args.put(param.substring(0, eq), param.substring(eq + 1)); 168 } 169 } 167 170 } 168 171 this.args = args; … … 237 240 } 238 241 } 239 242 240 243 public static class RequestHandlerForbiddenException extends RequestHandlerException { 241 244 private static final long serialVersionUID = 2263904699747115423L;
Note:
See TracChangeset
for help on using the changeset viewer.