tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amy...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets SsiInvokerServlet.java
Date Fri, 13 Apr 2001 21:00:38 GMT
amyroh      01/04/13 14:00:38

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        SsiInvokerServlet.java
  Log:
  Bug 1272 Fixed -- submitted by Vanitha Venkatraman.
  Takes care of single quotes inside of double quotes in errmsg.
  Added handling of null parameters so that it displays an error message instead of throwing
ServletException.
  
  Revision  Changes    Path
  1.5       +15 -12    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java
  
  Index: SsiInvokerServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SsiInvokerServlet.java	2001/04/03 22:39:32	1.4
  +++ SsiInvokerServlet.java	2001/04/13 21:00:37	1.5
  @@ -1,8 +1,8 @@
   /*
    * SsiInvokerServlet.java
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v
1.4 2001/04/03 22:39:32 amyroh Exp $
  - * $Revision: 1.4 $
  - * $Date: 2001/04/03 22:39:32 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/SsiInvokerServlet.java,v
1.5 2001/04/13 21:00:37 amyroh Exp $
  + * $Revision: 1.5 $
  + * $Date: 2001/04/13 21:00:37 $
    *
    * ====================================================================
    *
  @@ -98,7 +98,8 @@
    * Mapped to a path from within web.xml.
    *
    * @author Bip Thelin
  - * @version $Revision: 1.4 $, $Date: 2001/04/03 22:39:32 $
  + * @author Amy Roh
  + * @version $Revision: 1.5 $, $Date: 2001/04/13 21:00:37 $
    */
   public final class SsiInvokerServlet extends HttpServlet {
       /** Debug level for this servlet. */
  @@ -290,6 +291,12 @@
   		    byteCmp(unparsed, bIdx, bEnd)) {
                       inside = false;
                       bIdx += bEnd.length;
  +                    try {
  +                        strCmd = parseCmd(command);
  +                    } catch (IndexOutOfBoundsException ex) {
  +                        out.write(ssiMediator.getError());
  +                        continue;
  +                    }
                       strCmd = parseCmd(command);
                       strParamType = parseParamType(command, strCmd.length());
                       strParam = parseParam(command, strCmd.length());
  @@ -367,9 +374,8 @@
   		quotes=0;
   
   		while(bIdx < cmd.length()&&quotes!=2) {
  -		    if(cmd.charAt(bIdx)=='"'||
  -		       cmd.charAt(bIdx)=='\'')
  -			quotes++;
  +		    if(cmd.charAt(bIdx)=='"')
  +			    quotes++;
   
   		    bIdx++;
   		}
  @@ -402,8 +408,7 @@
   	while(bIdx < cmd.length()) {
   	    if(!inside) {
   		while(bIdx < cmd.length()&&
  -		      cmd.charAt(bIdx)!='"'&&
  -		      cmd.charAt(bIdx)!='\'')
  +		      cmd.charAt(bIdx)!='"')
   		    bIdx++;
   
   		if(bIdx>=cmd.length())
  @@ -411,9 +416,7 @@
   
   		inside=!inside;
   	    } else {
  -		while(bIdx < cmd.length()&&
  -		      cmd.charAt(bIdx)!='"'&&
  -		      cmd.charAt(bIdx)!='\'') {
  +		while(bIdx < cmd.length() && cmd.charAt(bIdx)!='"') {
   		    retBuf.append(cmd.charAt(bIdx));
   		    bIdx++;
   		}
  
  
  

Mime
View raw message