Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
beermeat opened this issue Aug 7, 2013 · 1 comment

Comments

@beermeat
Copy link

beermeat commented Aug 7, 2013

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(some@email.com, null)

1 Phalcon\Filter->sanitize(some@email.com, Array([0] => null, [1] => trim))

2 Phalcon\Validation->getValue(email)

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

phalcon 1.2.2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant