markt 2004/02/19 13:38:50 Modified: catalina/src/conf web.xml catalina/src/share/org/apache/catalina/servlets CGIServlet.java webapps/tomcat-docs cgi-howto.xml Log: Fix bug 27090. Make parameter encoding configurable. Default remains as is. Update docs. Add executable paramater to docs. Port from TC5. Revision Changes Path 1.53 +4 -0 jakarta-tomcat-4.0/catalina/src/conf/web.xml Index: web.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/conf/web.xml,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- web.xml 10 Dec 2003 22:15:03 -0000 1.52 +++ web.xml 19 Feb 2004 21:38:49 -0000 1.53 @@ -244,6 +244,10 @@ <!-- executable Name of the exectuable used to run the script. --> <!-- [perl] --> <!-- --> + <!-- parameterEncoding Name of parameter encoding to be used with CGI --> + <!-- servlet. --> + <!-- [System.getProperty("file.encoding","UTF-8")] --> + <!-- --> <!-- IMPORTANT: To use the CGI servlet, you also need to rename the --> <!-- $CATALINA_HOME/server/lib/servlets-cgi.renametojar file --> <!-- to $CATALINA_HOME/server/lib/servlets-cgi.jar --> 1.19 +14 -9 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java Index: CGIServlet.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/CGIServlet.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- CGIServlet.java 16 Feb 2004 23:41:54 -0000 1.18 +++ CGIServlet.java 19 Feb 2004 21:38:49 -0000 1.19 @@ -314,6 +314,10 @@ /** the executable to use with the script */ private String cgiExecutable = "perl"; + /** the encoding to use for parameters */ + private String parameterEncoding = System.getProperty("file.encoding", + "UTF-8"); + /** object used to ensure multiple threads don't try to expand same file */ static Object expandFileLock = new Object(); @@ -768,7 +772,8 @@ String param = paramNames.nextElement().toString(); if (param != null) { queryParameters.put( - param, URLEncoder.encode(req.getParameter(param))); + param, URLEncoder.encode(req.getParameter(param), + parameterEncoding)); } } @@ -1664,7 +1669,7 @@ if ((k.indexOf("=") < 0) && (v.indexOf("=") < 0)) { StringBuffer arg = new StringBuffer(k); arg.append("="); - v = java.net.URLEncoder.encode(v); + v = java.net.URLEncoder.encode(v, parameterEncoding); arg.append(v); if (arg.toString().indexOf(" ") < 0) { cmdAndArgs.append(arg); 1.3 +5 -0 jakarta-tomcat-4.0/webapps/tomcat-docs/cgi-howto.xml Index: cgi-howto.xml =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/cgi-howto.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- cgi-howto.xml 12 Jan 2003 17:26:46 -0000 1.2 +++ cgi-howto.xml 19 Feb 2004 21:38:50 -0000 1.3 @@ -57,6 +57,11 @@ Default is <code>100</code> seconds.</li> <li><strong>debug</strong> - Debugging detail level for messages logged by this servlet. Default 0.</li> +<li><strong>executable</strong> - The of the executable to be used to +run the script. Default is <code>perl</code>.</li> +<li><strong>parameterEncoding</strong> - Name of the parameter encoding +to be used with the GCI servlet. Default is +<code>System.getProperty("file.encoding","UTF-8")</code>.</li> </ul> </p>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]