You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ma...@apache.org on 2002/08/01 09:15:58 UTC

cvs commit: jakarta-commons-sandbox/fileupload/src/java/org/apache/commons/fileupload FileUpload.java

martinc     2002/08/01 00:15:57

  Modified:    fileupload/src/java/org/apache/commons/fileupload
                        FileUpload.java
  Log:
  Fix a bug where an empty file name for a file upload field would cause the
  field to be treated as a regular text field instead of a file field.
  
  Revision  Changes    Path
  1.9       +6 -10     jakarta-commons-sandbox/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java
  
  Index: FileUpload.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/fileupload/src/java/org/apache/commons/fileupload/FileUpload.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- FileUpload.java	22 Jul 2002 07:21:54 -0000	1.8
  +++ FileUpload.java	1 Aug 2002 07:15:57 -0000	1.9
  @@ -487,13 +487,9 @@
           {
               int start = cd.indexOf("filename=\"");
               int end = cd.indexOf('"', start + 10);
  -            if (start != -1 && end != -1 && (start + 10) != end)
  +            if (start != -1 && end != -1)
               {
  -                String str = cd.substring(start + 10, end).trim();
  -                if (str.length() > 0)
  -                {
  -                    fileName = str;
  -                }
  +                fileName = cd.substring(start + 10, end).trim();
               }            
           }
           return fileName;
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>