File tree Expand file tree Collapse file tree
core/src/main/java/com/ocpsoft/pretty/faces/url Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ Bugfixes:
66* Fixed incorrect encoding of URLs when using the 'url' attribute for rewrite rules.
77* MultiPageMessagesSupport doesn't duplicate messages any more if using MyFaces.
88* Fixed potential NullPointerExceptions on FacesContext access.
9+ * Ignore query parameters that are not correctly encoded (#88)
10+
911
1012------------------------------------
1113 VERSION 3.2.0
Original file line number Diff line number Diff line change 3030import java .util .Map .Entry ;
3131import java .util .TreeMap ;
3232
33+ import org .apache .commons .logging .Log ;
34+ import org .apache .commons .logging .LogFactory ;
35+
3336import com .ocpsoft .pretty .PrettyException ;
3437import com .ocpsoft .pretty .faces .config .mapping .RequestParameter ;
3538
3841 */
3942public class QueryString
4043{
44+
45+ private final static Log log = LogFactory .getLog (QueryString .class );
46+
4147 private final Map <String , List <String >> parameters = new LinkedHashMap <String , List <String >>();
4248
4349 /**
@@ -244,6 +250,12 @@ public void addParameters(String url)
244250 name = URLDecoder .decode (pair .substring (0 , pos ), "UTF-8" );
245251 value = URLDecoder .decode (pair .substring (pos + 1 , pair .length ()), "UTF-8" );
246252 }
253+ catch (IllegalArgumentException e )
254+ {
255+ // thrown by URLDecoder if character decoding fails
256+ log .warn ("Ignoring invalid query parameter: " +pair );
257+ continue ;
258+ }
247259 catch (UnsupportedEncodingException e )
248260 {
249261 throw new PrettyException (
You can’t perform that action at this time.
0 commit comments