diff options
author | Friendika <info@friendika.com> | 2010-11-15 20:22:40 -0800 |
---|---|---|
committer | Friendika <info@friendika.com> | 2010-11-15 20:22:40 -0800 |
commit | 949842a88d3f3c84fc87fbb549b2b397076dcbc5 (patch) | |
tree | ecaae2aa2ded99d902881045c0e96f8a1b3073e2 /boot.php | |
parent | f9497bcb95abae02427f9fe7e998bce29923020c (diff) | |
download | volse-hubzilla-949842a88d3f3c84fc87fbb549b2b397076dcbc5.tar.gz volse-hubzilla-949842a88d3f3c84fc87fbb549b2b397076dcbc5.tar.bz2 volse-hubzilla-949842a88d3f3c84fc87fbb549b2b397076dcbc5.zip |
validate email addresses to see if the hostnames actually resolve before committing a new user
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 20 |
1 files changed, 16 insertions, 4 deletions
@@ -1160,13 +1160,25 @@ function validate_url(&$url) { $url = 'http://' . $url; $h = parse_url($url); - if(! $h) { - return false; + if(($h) && (checkdnsrr($h['host'], 'ANY'))) { + return true; } - if(! checkdnsrr($h['host'], 'ANY')) { + return false; +}} + +// checks that email is an actual resolvable internet address + +if(! function_exists('validate_email')) { +function validate_email($addr) { + + if(! strpos($addr,'@')) return false; + $h = substr($addr,strpos($addr,'@') + 1); + + if(($h) && (checkdnsrr($h, 'ANY'))) { + return true; } - return true; + return false; }} // Check $url against our list of allowed sites, |