- Match the ENTIRE string in isEmailAddress, because otherwise things like :

"dave@slicer.ca';DROP TABLE students; --" will match.
This commit is contained in:
dave 2007-11-09 07:20:10 +00:00
parent 41053418d8
commit fb65e87587

View File

@ -796,7 +796,7 @@ function outputStatus($status)
//returns true if its a valid email address, false if its not
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;
else
return false;