Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 70559 invoked from network); 2 Feb 2002 04:46:13 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Feb 2002 04:46:13 -0000 Received: (qmail 21638 invoked by uid 97); 2 Feb 2002 04:46:12 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 21616 invoked by uid 97); 2 Feb 2002 04:46:11 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 21605 invoked by uid 97); 2 Feb 2002 04:46:11 -0000 Date: 2 Feb 2002 04:46:01 -0000 Message-ID: <20020202044601.19353.qmail@icarus.apache.org> From: larryi@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf UDecoder.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N larryi 02/02/01 20:46:01 Modified: util/java/org/apache/tomcat/util/buf UDecoder.java Log: In a query string, '+' is a substitute for space, but not in the path portion of a URL. Add methods that include a "query" parameter to control if the '+' should be converted to a space. Revision Changes Path 1.5 +46 -10 jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/UDecoder.java Index: UDecoder.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/buf/UDecoder.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- UDecoder.java 31 Dec 2001 18:20:04 -0000 1.4 +++ UDecoder.java 2 Feb 2002 04:46:01 -0000 1.5 @@ -78,9 +78,18 @@ { } + /** URLDecode, will modify the source. Includes converting + * '+' to ' '. + */ + public void convert( ByteChunk mb ) + throws IOException + { + convert(mb, true); + } + /** URLDecode, will modify the source. */ - public void convert(ByteChunk mb) + public void convert( ByteChunk mb, boolean query ) throws IOException { int start=mb.getOffset(); @@ -88,7 +97,9 @@ int end=mb.getEnd(); int idx= mb.indexOf( buff, start, end, '%' ); - int idx2= mb.indexOf( buff, start, end, '+' ); + int idx2=-1; + if( query ) + idx2= mb.indexOf( buff, start, end, '+' ); if( idx<0 && idx2<0 ) { return; } @@ -98,7 +109,7 @@ if( idx < 0 ) idx=idx2; for( int j=idx; j For additional commands, e-mail: