From ee0366a862815e70c344b17e8f0063c178bf86bb Mon Sep 17 00:00:00 2001 From: hmhealey Date: Wed, 6 Jan 2016 15:30:11 -0500 Subject: Removed email regex --- web/react/utils/utils.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web') 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) { -- cgit v1.2.3-1-g7c22