Permalink
Browse files

[#1238] Non-url encoded incoming post-data result in an application e…

…rror
  • Loading branch information...
1 parent 3481392 commit 6a5d11f4fec969433bdf4536f342cb360b81dd59 @pepite pepite committed Nov 14, 2011
Showing with 12 additions and 3 deletions.
  1. +12 −3 framework/src/play/data/parsing/UrlEncodedParser.java
@@ -104,10 +104,19 @@
// 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);
+ }
}
}

0 comments on commit 6a5d11f

Please sign in to comment.