Skip to content

Commit

Permalink
[#1238] Non-url encoded incoming post-data result in an application e…
Browse files Browse the repository at this point in the history
…rror
  • Loading branch information
pepite committed Nov 14, 2011
1 parent d09d5a5 commit 00aec8d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions framework/src/play/data/parsing/UrlEncodedParser.java
Expand Up @@ -104,10 +104,19 @@ public Map<String, String[]> parse(InputStream is) {
// We're ready to decode the params
Map<String, String[]> decodedParams = new HashMap<String, String[]>(params.size());
for (Map.Entry<String, String[]> e : params.entrySet()) {
String key = URLDecoder.decode(e.getKey(),charset);
String key = e.getKey();
try {
key = URLDecoder.decode(e.getKey(), charset);
} catch (Throwable z) {
// Nothing we can do about, ignore
}
for (String value : e.getValue()) {

Utils.Maps.mergeValueInMap(decodedParams, key, (value==null ? null : URLDecoder.decode(value,charset)));
try {
Utils.Maps.mergeValueInMap(decodedParams, key, (value == null ? null : URLDecoder.decode(value, charset)));
} catch (Throwable z) {
// Nothing we can do about, lets fill in with the non decoded value
Utils.Maps.mergeValueInMap(decodedParams, key, value);
}
}
}

Expand Down

0 comments on commit 00aec8d

Please sign in to comment.