summaryrefslogtreecommitdiff
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/aur.inc.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php
index c662b80..7c92bb6 100644
--- a/web/lib/aur.inc.php
+++ b/web/lib/aur.inc.php
@@ -80,7 +80,18 @@ function check_sid($dbh=NULL) {
# verify that an email address looks like it is legitimate
#
function valid_email($addy) {
- return (filter_var($addy, FILTER_VALIDATE_EMAIL) !== false);
+ // check against RFC 3696
+ if (filter_var($addy, FILTER_VALIDATE_EMAIL) === false) {
+ return false;
+ }
+
+ // check dns for mx, a, aaaa records
+ list($local, $domain) = explode('@', $addy);
+ if (!(checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A') || checkdnsrr($domain, 'AAAA'))) {
+ return false;
+ }
+
+ return true;
}
# a new seed value for mt_srand()