cjsolomon / Mulit-Modal

SRU Multi-Modal Project
0 stars 2 forks source link

isValidEmail #14

Closed ghost closed 10 years ago

ghost commented 10 years ago

There is something wrong with the isValiedEmail format checker. Check out the code for isValidEmailTest() and look at the email's I am trying to pass as valid. They are failing and I am not sure why.

Suggestions: Since email doesn't care about casing make everything either upper or lower then you only worry about one case in your pattern. Also may want to make the domain check accept any two - four letter combo. We currently don't support any of the country code domains or any of the four letter domains. We also exclude a majority of the three letter domains.

zgp1001 commented 10 years ago

Your email check function was calling the isValidPhone() function which is why the correct ones were returning false. Took me forever to figure out what was going on cause I have my own small checker file and it was working for me@the.com.

However you bring up some good points. I'm changing it to accept any 3-4 character domain. Right now with what I have it accepts at least one that it shouldn't, however.

Leaving this open right now and will push my changes in a second.

zgp1001 commented 10 years ago

Alright, got the emails passing the current JUnit tests.

Might want to throw some more crazy stuff at it though as there may be unintended acceptance still possible. I'll try and break it as well.

ghost commented 10 years ago

It still isn't accepting a two letter domain. Also what is the status with is valid date? Is that still under development? If so I am going to skip it and move on.

zgp1001 commented 10 years ago

Yeah didn't do date. I think java has a built in date thing. Been meaning to get to it.

And I only had it accept 3-4 letter domains. Wasn't aware of any 2 letter ones. Easy fix.

zgp1001 commented 10 years ago

Alright date checker is now supported so tests can be written for that. Required formats are either A) January 1 2014 B) 01/1/2014

These are the formats we currently have in our DB so I supported both of them.

Also there is now an isNumeric function for testing if a string is a number or not.

Finally, I changed the email tester to support 2-4 letter domains.

If there are any issues with any of the format checking, let me know.

ghost commented 10 years ago

email seems to be working good now