cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG] any filter in Forms throws an exception: Sanitize filter is not supported

Open beermeat opened this issue 13 years ago • 1 comments

class Login extends Form
{
    public function initialize()
    {
        $email = new Text('email');
        $email->addValidator(new Email());
        $email->addFilter('trim'); //int, striptags, lower... etc, no matter
        $this->add($email);
    }
}
if ($form->isValid($_POST)) {

}

and we can see an exception with mystical NULL in the trace:

Phalcon\Filter\Exception: Sanitize filter is not supported

0 Phalcon\Filter->_sanitize([email protected], null)

1 Phalcon\Filter->sanitize([email protected], Array([0] => null, [1] => trim))

2 Phalcon\Validation->getValue(email)

3 Phalcon\Validation\Validator\Email->validate(Object(Phalcon\Validation), email)

phalcon 1.2.2

beermeat avatar Aug 07 '13 09:08 beermeat

thanks!

beermeat avatar Aug 07 '13 15:08 beermeat