Encode ampersand (“&”) and equals signs (“=”) in URL.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Mar 2011 15:34:13 +0000 (16:34 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 21 Mar 2011 15:34:13 +0000 (16:34 +0100)
src/main/java/net/pterodactylus/sone/web/SoneTemplatePage.java

index a6a87df..a04873d 100644 (file)
@@ -213,12 +213,12 @@ public class SoneTemplatePage extends TemplatePage {
                                StringBuilder requestParameters = new StringBuilder();
                                for (String parameterName : httpRequest.getParameterNames()) {
                                        if (requestParameters.length() > 0) {
-                                               requestParameters.append('&');
+                                               requestParameters.append("%26");
                                        }
                                        String[] parameterValues = httpRequest.getMultipleParam(parameterName);
                                        for (String parameterValue : parameterValues) {
                                                try {
-                                                       requestParameters.append(URLEncoder.encode(parameterName, "UTF-8")).append('=').append(URLEncoder.encode(parameterValue, "UTF-8"));
+                                                       requestParameters.append(URLEncoder.encode(parameterName, "UTF-8")).append("%3d").append(URLEncoder.encode(parameterValue, "UTF-8"));
                                                } catch (UnsupportedEncodingException uee1) {
                                                        /* A JVM without UTF-8? I don’t think so. */
                                                }