You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/05/23 22:34:31 UTC

svn commit: r541058 - /myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java

Author: bommel
Date: Wed May 23 13:34:30 2007
New Revision: 541058

URL: http://svn.apache.org/viewvc?view=rev&rev=541058
Log:
(TOBAGO-407) tc:validateFileItem forces required="true"

Modified:
    myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java

Modified: myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java?view=diff&rev=541058&r1=541057&r2=541058
==============================================================================
--- myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java (original)
+++ myfaces/tobago/tags/tobago-1.0.11/core/src/main/java/org/apache/myfaces/tobago/validator/FileItemValidator.java Wed May 23 13:34:30 2007
@@ -60,7 +60,8 @@
             DoubleRangeValidator.MAXIMUM_MESSAGE_ID, FacesMessage.SEVERITY_ERROR, args);
         throw new ValidatorException(facesMessage);
       }
-      if (contentType != null
+      // Check only a valid file
+      if (file.getSize() > 0 && contentType != null
           && !ContentType.valueOf(contentType).match(ContentType.valueOf(file.getContentType()))) {
         // TODO i18n
         String text = "ContentType " + file.getContentType() + " not expected.";