Hi,
i have this issue when i use a RegExp on several fields, an "0" is accepted, even when i set a minimum of characters.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_validation.validators.zip | 2.83 KB | Mariano |
Hi,
i have this issue when i use a RegExp on several fields, an "0" is accepted, even when i set a minimum of characters.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | webform_validation.validators.zip | 2.83 KB | Mariano |
Comments
Comment #1
Mariano commentedHi, this looks like a logical problem on line 304 of the file webform_validation.validators.inc:
The IF will never validate if the value of $val is 0 (which is taken from the form field), because it takes it as FALSE. Since what the code is trying to check is if the variable has any value, I believe that it should be enclosed by the function isset().
There are actually a lot of validators using the same approach.
Comment #2
Mariano commentedSubmitting a patched webform_validation.validators.inc file
Comment #3
svendecabooterGood catch!
I have updated the code so it only checks for empty strings to skip validation. All other entered values should be always be validated...