Revision: 1455
          http://stripes.svn.sourceforge.net/stripes/?rev=1455&view=rev
Author:   bengunter
Date:     2011-12-02 18:43:27 +0000 (Fri, 02 Dec 2011)
Log Message:
-----------
Applied fix for STS-845 from 1.5.x branch.

Modified Paths:
--------------
    
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java

Modified: 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
===================================================================
--- 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2011-12-02 18:41:26 UTC (rev 1454)
+++ 
trunk/stripes/src/net/sourceforge/stripes/controller/DefaultActionBeanPropertyBinder.java
   2011-12-02 18:43:27 UTC (rev 1455)
@@ -484,6 +484,15 @@
                     // in the set of fields that were on the page
                     if (!wizard || fieldsOnPage.contains(propertyName)) {
                         String[] values = 
trim(request.getParameterValues(propertyName), validationInfo);
+
+                        // Decrypt encrypted fields before checking for null
+                        if (validationInfo.encrypted()) {
+                            for (int i = 0, n = values.length; i < n; i++) {
+                                if (values[i] != null)
+                                    values[i] = CryptoUtil.decrypt(values[i]);
+                            }
+                        }
+
                         log.debug("Checking required field: ", propertyName, 
", with values: ", values);
                         checkSingleRequiredField(propertyName, propertyName, 
values, stripesReq, errors);
                     }
@@ -575,7 +584,7 @@
         }
         else {
             for (String value : values) {
-                if (value.length() == 0) {
+                if (value == null || value.length() == 0) {
                     ValidationError error = new 
ScopedLocalizableError("validation.required",
                             "valueNotPresent");
                     error.setFieldValue(value);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to