cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util RequestUtil.java

2004-05-26 Thread yoavs
yoavs   2004/05/26 09:26:10

  Modified:catalina/src/share/org/apache/catalina/util RequestUtil.java
  Log:
  Minor JavaDoc fixes (Bugzilla 28335)
  
  Revision  ChangesPath
  1.8   +5 -6  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RequestUtil.java  27 Feb 2004 14:58:50 -  1.7
  +++ RequestUtil.java  26 May 2004 16:26:10 -  1.8
  @@ -276,7 +276,6 @@
*
* @param map Map that accumulates the resulting parameters
* @param data Input string containing request parameters
  - * @param urlParameters true if we're parsing parameters on the URL
*
* @exception IllegalArgumentException if the data is malformed
*/
  @@ -416,12 +415,12 @@
   
   
   /**
  - * Put name value pair in map.
  - *
  - * @param b the character value byte
  - *
* Put name and value pair in map.  When name already exist, add value
* to array of values.
  + *
  + * @param map The map to populate
  + * @param name The parameter name
  + * @param value The parameter value
*/
   private static void putMapEntry( Map map, String name, String value) {
   String[] newValues = null;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util RequestUtil.java

2003-09-12 Thread luehe
luehe   2003/09/12 12:54:57

  Modified:catalina/src/share/org/apache/catalina/util RequestUtil.java
  Log:
  Reverted patch for 4918152 ("using % in the value of jsp:param
  corrupts the query string"), as it is not needed for JSP 2.0.
  
  JSP.5.6 ("") has clarified the potential trouble spot as follows:
  
The parameter names and values specified should be left unencoded by the
page author. The JSP container must encode the parameter names and values
using the character encoding from the request object when necessary. For
example, if the container chooses to append the parameters to the URL in
the dispatched request, both the names and values must be encoded as per
the content type application/x-www-form-urlencoded in the HTML specification.
  
  Revision  ChangesPath
  1.6   +6 -11 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- RequestUtil.java  11 Sep 2003 01:59:51 -  1.5
  +++ RequestUtil.java  12 Sep 2003 19:54:56 -  1.6
  @@ -536,13 +536,8 @@
   data[ox++] = (byte)' ';
   break;
   case '%':
  -if ((ix <= (data.length - 2)) &&
  -((char)data[ix] != '&') && ((char)data[ix+1] != '&')) {
  -data[ox++] = (byte)((convertHexDigit(data[ix++]) << 4)
  -   + convertHexDigit(data[ix++]));
  -} else {
  -data[ox++] = c;
  -}
  +data[ox++] = (byte)((convertHexDigit(data[ix++]) << 4)
  ++ convertHexDigit(data[ix++]));
   break;
   default:
   data[ox++] = c;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util RequestUtil.java

2003-09-10 Thread luehe
luehe   2003/09/10 18:59:51

  Modified:catalina/src/share/org/apache/catalina/util RequestUtil.java
  Log:
  Fix for 4918152 ("using % in the value of jsp:param corrupts the query string")
  
  Patch provided by [EMAIL PROTECTED]
  
  Revision  ChangesPath
  1.5   +11 -6 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RequestUtil.java  2 Sep 2003 21:22:06 -   1.4
  +++ RequestUtil.java  11 Sep 2003 01:59:51 -  1.5
  @@ -536,8 +536,13 @@
   data[ox++] = (byte)' ';
   break;
   case '%':
  -data[ox++] = (byte)((convertHexDigit(data[ix++]) << 4)
  -+ convertHexDigit(data[ix++]));
  +if ((ix <= (data.length - 2)) &&
  +((char)data[ix] != '&') && ((char)data[ix+1] != '&')) {
  +data[ox++] = (byte)((convertHexDigit(data[ix++]) << 4)
  +   + convertHexDigit(data[ix++]));
  +} else {
  +data[ox++] = c;
  +}
   break;
   default:
   data[ox++] = c;
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util RequestUtil.java

2003-02-14 Thread amyroh
amyroh  2003/02/14 14:23:04

  Modified:catalina/src/share/org/apache/catalina/util RequestUtil.java
  Log:
  Use the specified encoding to extract bytes out of the given string so
  that the encoding is not lost. If an encoding is not specified, let it
  use the platform default encoding.  Fixes bugtraq 4697359.
  
  Revision  ChangesPath
  1.3   +29 -10
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RequestUtil.java  14 Feb 2003 22:04:47 -  1.2
  +++ RequestUtil.java  14 Feb 2003 22:23:04 -  1.3
  @@ -331,9 +331,20 @@
   throws UnsupportedEncodingException {
   
   if ((data != null) && (data.length() > 0)) {
  -int len = data.length();
  -byte[] bytes = new byte[len];
  -data.getBytes(0, len, bytes, 0);
  +
  +// use the specified encoding to extract bytes out of the
  +// given string so that the encoding is not lost. If an
  +// encoding is not specified, let it use platform default
  +byte[] bytes = null;
  +try {
  +if (encoding == null) {
  +bytes = data.getBytes();
  +} else {
  +bytes = data.getBytes(encoding);
  +}
  +} catch (UnsupportedEncodingException uee) {
  +}
  +
   parseParameters(map, bytes, encoding);
   }
   
  @@ -371,9 +382,17 @@
   if (str == null)
   return (null);
   
  -int len = str.length();
  -byte[] bytes = new byte[len];
  -str.getBytes(0, len, bytes, 0);
  +// use the specified encoding to extract bytes out of the
  +// given string so that the encoding is not lost. If an
  +// encoding is not specified, let it use platform default
  +byte[] bytes = null;
  +try {
  +if (enc == null) {
  +bytes = str.getBytes();
  +} else {
  +bytes = str.getBytes(enc);
  +}
  +} catch (UnsupportedEncodingException uee) {}
   
   return URLDecode(bytes, enc);
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util RequestUtil.java

2003-02-14 Thread amyroh
amyroh  2003/02/14 14:04:47

  Modified:catalina/src/share/org/apache/catalina/util RequestUtil.java
  Log:
  Allow query string values to contain '=' characters.  Fixes bugtraq 4697925.
  
  Revision  ChangesPath
  1.2   +11 -8 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java
  
  Index: RequestUtil.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/util/RequestUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RequestUtil.java  18 Jul 2002 16:47:46 -  1.1
  +++ RequestUtil.java  14 Feb 2003 22:04:47 -  1.2
  @@ -506,9 +506,13 @@
   ox = 0;
   break;
   case '=':
  -key = new String(data, 0, ox, encoding);
  -ox = 0;
  -break;
  +if (key == null) {
  +key = new String(data, 0, ox, encoding);
  +ox = 0;
  +} else {
  +data[ox++] = c;
  +}   
  +break;  
   case '+':
   data[ox++] = (byte)' ';
   break;
  @@ -532,4 +536,3 @@
   
   
   }
  -
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]