forked from science-ation/science-ation
- Match the ENTIRE string in isEmailAddress, because otherwise things like :
"dave@slicer.ca';DROP TABLE students; --" will match.
This commit is contained in:
parent
41053418d8
commit
fb65e87587
@ -796,7 +796,7 @@ function outputStatus($status)
|
|||||||
|
|
||||||
//returns true if its a valid email address, false if its not
|
//returns true if its a valid email address, false if its not
|
||||||
function isEmailAddress($str) {
|
function isEmailAddress($str) {
|
||||||
if(eregi('[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})', $str))
|
if(eregi('^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,4})$', $str))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user