- int fieldIndex = Numbers.safeParseInteger(request.getHttpRequest().getParam("field"), -1);
- if (fieldIndex >= currentSone.getProfile().getFieldNames().size()) {
- fieldIndex = -1;
- }
- String fieldName = null;
- String fieldValue = null;
- if (fieldIndex > -1) {
- fieldName = profile.getFieldNames().get(fieldIndex);
- fieldValue = profile.getField(fieldName);
+
+ /* get parameters from request. */
+ String fieldId = request.getHttpRequest().getParam("field");
+ Field field = profile.getFieldById(fieldId);
+ if (field == null) {
+ throw new RedirectException("invalid.html");