summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-01-06 15:52:28 -0500
committerJoram Wilander <jwawilander@gmail.com>2016-01-06 15:52:28 -0500
commit5855b5e4590889944e4a408f7185f84779fc701a (patch)
tree1a9e0fb93b73fe57ef5e0747f82a9b4d07bb3a17 /web
parentfe7d27ba4b04537e39357227bcc55f8b92ee6ee2 (diff)
parentee0366a862815e70c344b17e8f0063c178bf86bb (diff)
downloadchat-5855b5e4590889944e4a408f7185f84779fc701a.tar.gz
chat-5855b5e4590889944e4a408f7185f84779fc701a.tar.bz2
chat-5855b5e4590889944e4a408f7185f84779fc701a.zip
Merge pull request #1819 from hmhealey/plt1401
PLT-1401 Removed email regex
Diffstat (limited to 'web')
-rw-r--r--web/react/utils/utils.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index e84fdf671..33aae7d1e 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) {