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