Author: jleroux
Date: Sun Dec 2 04:58:01 2007
New Revision: 600278
URL:
http://svn.apache.org/viewvc?rev=600278&view=revLog:
A patch from Jeremy Wickersheimer "makeLoginUrl doesn't URL encode the strings" (
https://issues.apache.org/jira/browse/OFBIZ-1199) - OFBIZ-1199
Modified:
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java?rev=600278&r1=600277&r2=600278&view=diff==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/LoginWorker.java Sun Dec 2 04:58:01 2007
@@ -23,6 +23,8 @@
import java.util.regex.Matcher;
import java.security.cert.X509Certificate;
import java.math.BigInteger;
+import java.net.URLEncoder;
+import java.io.UnsupportedEncodingException;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
@@ -89,8 +91,21 @@
String paramName = (String) parameterNames.nextElement();
if (paramName != null) {
- if (queryString == null) queryString = paramName + "=" + request.getParameter(paramName);
- else queryString = queryString + "&" + paramName + "=" + request.getParameter(paramName);
+ String sane_paramName, sane_value;
+ try {
+ sane_paramName = URLEncoder.encode((String) paramName, "UTF-8");
+ sane_value = URLEncoder.encode(request.getParameter(paramName), "UTF-8");
+ } catch (UnsupportedEncodingException ex) {
+ Debug.logError(ex, module);
+ sane_paramName = paramName;
+ sane_value = request.getParameter(paramName);
+ }
+
+ if (queryString == null) {
+ queryString = sane_paramName + "=" + sane_value;
+ } else {
+ queryString = queryString + "&" + sane_paramName + "=" + sane_value;
+ }
}
}