diff options
Diffstat (limited to 'web/react/utils')
-rw-r--r-- | web/react/utils/utils.jsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index a808c9be3..bdc9083ec 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -15,9 +15,9 @@ import * as client from './client.jsx'; import Autolinker from 'autolinker'; export function isEmail(email) { - //var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; - var regex = /^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i; - return regex.test(email); + // writing a regex to match all valid email addresses is really, really hard (see http://stackoverflow.com/a/201378) + // so we just do a simple check and rely on a verification email to tell if it's a real address + return email.indexOf('@') !== -1; } export function cleanUpUrlable(input) { |