Browse Source

fix issue with form regex being required when no regex value present

Jason Rivard 8 years ago
parent
commit
8ffe006fa8

+ 1 - 1
src/main/java/password/pwm/http/servlet/AbstractPwmServlet.java

@@ -220,7 +220,7 @@ public abstract class AbstractPwmServlet extends HttpServlet implements PwmServl
 
             case ERROR_UNKNOWN:
             default:
-                LOGGER.fatal(e.getErrorInformation().toDebugStr());
+                LOGGER.fatal(pwmSession, "unexpected error: " + e.getErrorInformation().toDebugStr());
                 try { // try to update stats
                     if (pwmSession != null) {
                         pwmApplication.getStatisticsManager().incrementValue(Statistic.PWM_UNKNOWN_ERRORS);

+ 1 - 1
src/main/resources/password/pwm/i18n/PwmSetting.properties

@@ -234,7 +234,7 @@ Setting_Description_captcha.skip.param=Specify a parameter with a key of "skipCa
 Setting_Description_cas.clearPassUrl=For <a href\="http\://www.jasig.org/cas">CAS</a> authentication integration, enter the ClearPass url here.  If blank, CAS authentication integration will be disabled.<br/><br/>You will also need to edit the <i>WEB-INF/web.xml</i> file to enable CAS integration.  Uncomment the section for the CAS servlet filters, and modify the CAS servlet parameters as appropriate for your configuration.
 Setting_Description_cas.clearPass.key=<a href\="https://apereo.github.io/cas/4.2.x/integration/ClearPass.html">ClearPass</a> encryption key
 Setting_Description_cas.clearPass.alg=The algorithm used by the encryption key
-Setting_Description_challenge.allowDuplicateResponses=Enable this option if you require each response to be unique.
+Setting_Description_challenge.allowDuplicateResponses=Enable this to allow duplicate responses in setup security responses
 Setting_Description_challenge.allowSetup.queryMatch=Specify the permissions used to determine if you permits the users to configure challenges.  This LDAP query must return the user or else @PwmAppName@ does not permit the user to configure challenges.
 Setting_Description_challenge.allowUnlock=Enable this option if @PwmAppName@ allows user accounts to be unlocked during forgotten password.  If true, and if the users' accounts are locked due to too many invalid login attempts, and the users' passwords are not expired, then @PwmAppName@ gives the users a chance to unlock their accounts instead of resetting their passwords.
 Setting_Description_challenge.caseInsensitive=Enable to control the case sensitivity of responses.  If enabled, then @PwmAppName@ deems the responses correct even if the case is wrong.  Changing this value does not change existing stored responses -- @PwmAppName@ saves the case sensitive flag on each users' stored responses.

+ 2 - 2
src/main/webapp/WEB-INF/jsp/fragment/form.jsp

@@ -101,7 +101,7 @@
     <% } else { %>
     <input style="text-align: left;" id="<%=loopConfiguration.getName()%>" type="<%=loopConfiguration.getType()%>" class="inputfield"
            name="<%=loopConfiguration.getName()%>" value="<%= currentValue %>"
-        <%if (loopConfiguration.getRegex() != null) {%> pattern="<%=loopConfiguration.getRegex()%>"<%}%>
+        <%if (!StringUtil.isEmpty(loopConfiguration.getRegex())) {%> pattern="<%=loopConfiguration.getRegex()%>"<%}%>
         <%if(loopConfiguration.getPlaceholder()!=null){%> placeholder="<%=loopConfiguration.getPlaceholder()%>"<%}%>
         <%if(loopConfiguration.isRequired()){%> required="required"<%}%>
     <pwm:autofocus/> maxlength="<%=loopConfiguration.getMaximumLength()%>">
@@ -114,7 +114,7 @@
     </label>
     <input style="" id="<%=loopConfiguration.getName()%>_confirm" type="<%=loopConfiguration.getType()%>" class="inputfield"
            name="<%=loopConfiguration.getName()%>_confirm"
-            <%if (loopConfiguration.getRegex() != null) {%> pattern="<%=loopConfiguration.getRegex()%>"<%}%>
+            <%if (!StringUtil.isEmpty(loopConfiguration.getRegex())) {%> pattern="<%=loopConfiguration.getRegex()%>"<%}%>
             <%if(loopConfiguration.isRequired()){%> required="required"<%}%>
             <%if(loopConfiguration.isReadonly()){%> readonly="readonly"<%}%>
            maxlength="<%=loopConfiguration.getMaximumLength()%>"/>