commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mart...@apache.org
Subject cvs commit: jakarta-commons-sandbox/fileupload/src/java/org/apache/commons/fileupload FileUpload.java
Date Thu, 01 Aug 2002 07:15:58 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message