Escape Email Address - Best Practices

1.5k Views Asked by At

What are the best practices for user registration via web page, in regards to escaping characters? If someone registers and email address like [email protected] what should be escaped? Should you use encodeURIComponent on the whole address, escaping + and @ with %2B1 and %40? I recently ran into a problem where the + was not escaped and was saved as a space, which resulted in the user not being found in the db. Any suggestions?

1

There are 1 best solutions below

0
On

In our system, we escape only '+', with %2B.