Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Filters - email removes the ' character #10595

Closed
AmazingDreams opened this issue Jul 6, 2015 · 4 comments
Closed

Filters - email removes the ' character #10595

AmazingDreams opened this issue Jul 6, 2015 · 4 comments

Comments

@AmazingDreams
Copy link
Contributor

According to Wikipedia the following special characters are allowed in an email address:

"These special characters: # - _ ~ ! $ & ' ( ) * + , ; = : and percentile encoding i.e. %20"

https://en.wikipedia.org/wiki/Email_address#Local_part

Also when you do a 'native' php filter_var call, the ' character is not removed:

$email = "some'email@example.com";
echo filter_var($email, FILTER_SANITIZE_EMAIL); // some'email@example.com

Why does Phalcon remove the ' character?

https://github.com/phalcon/cphalcon/blob/master/phalcon/filter.zep#L150

@williamokano
Copy link

Good question. Apostrophes should be valid before the @ symbol yet most of the big e-mail companies do not accept them.

👍

@AmazingDreams
Copy link
Contributor Author

I'd say that following the standards is more important than following big e-mail companies. This gives Phalcon users more fine-grained control over what they want to allow. I was pretty surprised myself that the ' got removed.

Besides, if you look at the email validator, it uses the native FILTER_VALIDATE_EMAIL constant. https://github.com/phalcon/cphalcon/blob/master/phalcon/validation/validator/email.zep#L55

@AmazingDreams
Copy link
Contributor Author

I closed the old pull request as that one was trying to merge with master. Which I shouldnt

andresgutierrez added a commit that referenced this issue Jul 8, 2015
The filter now no longer removes the ' character, fixes #10595
@andresgutierrez
Copy link
Contributor

Fixed in the 2.0.x branch

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

No branches or pull requests

3 participants