cphalcon
cphalcon copied to clipboard
[BUG][1.3.0] - getPost & get sanitize not work
$_POST['email'] = "not email"; $email = $this->request->getPost('email','email'); echo $email;
result: not email
should false
This not bug. The result same as this:
echo filter_var("not email", FILTER_SANITIZE_EMAIL);
i expected VALIDATE not SANITIZE
var_dump(filter_var("not email", FILTER_VALIDATE_EMAIL));
bool(false)
In get* method is sanitize.
Is any way to validate than sanitize, because more useful in this case is get false than "notemail" string which is not email?
I checked other case
var_dump($this->request->getPost('email','int'));
string(0) ""
$this->request->getPost('email','email');
This is sanitizing... not validation...