In fact, I missed the ! operator on that line during editing the code on pastie (now corrected version: http://pastie.org/654380). Unfortunately, the behaviour does not change when I correct that line. Still gives email domain is not allowed.
The allowed domains comes from application.ini file (debugged). the form element is also working fine (debugged). Yet only this validation... On Wed, Oct 14, 2009 at 4:23 PM, Carlton Gibson <[email protected]> wrote: > > On 14 Oct 2009, at 13:59, scs wrote: > >> Hello, >> I have a custom validation class that validates if an e-mail domain is >> in the allowed domains list via the native inArray validator of Zend. >> Here is the code: http://pastie.org/654380 >> >> However, the validator always returns false and gives the form error " >> email domain is not allowed " as in the validation class. >> If I do the check with the php's in_array function then I get the >> desired behaviour. >> >> Something missing? > > Yes. The test condition on Line 27 of your example needs a negation if you > want to do the logic that way round. Either add or exchange the branch > bodies. > > HTH >
