Hello Agavi People!

As the subject eludes, I'm having an issue with validators.xml definitions and 
the AgaviRegexValidator. It could be something simple I am just not seeing and 
need some extra eyeballs on, but here it is.

In app/config/validators.xml I have the following definition:
            <validator_definition class="AgaviRegexValidator" 
name="complexPassword">
                <ae:parameter 
name="pattern">((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15})</ae:parameter>
            </validator_definition>

However when I am implementing it in my action no matter what I enter (except 
empty) is passing validation. My action validator has the following definition:
            <validator class="complexPassword" required="true" 
depends="oldpassword" provides="newpassword">
                <argument>newpassword</argument>
                <error>A password must be 8-15 characters, include digits, 
lower case and upper case characters</error>
            </validator>

If I use the same definition directly inside my action validator it works as 
expected:
            <validator class="regex" required="true" provides="newpassword" 
depends="oldpassword">
                <argument>newpassword</argument>
                <ae:parameter 
name="pattern">((?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,15})</ae:parameter>
                <error>A password must be 8-15 characters, include digits, 
lower case and upper case characters</error>
            </validator>

Just as a test, if I change the app/config/validators.xml definition to 
something like AgaviStringValidator with a min length of 8 and use that named 
validator in the action, then it works as expected. To me it is looking like 
the AgaviRegexValidator isn't working as a named definition.

Any suggestions or thoughts would be appreciated.

Regards,
Michael


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to