From e686b495a86fd7d1fd537dea56fa9b9e148045f7 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sat, 25 Jun 2011 11:32:11 +0200 Subject: Stricter email address validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use PHP's filter extension to validate mail addresses. The filter extension is enabled by default as of PHP 5.2.0. Thanks-to: Florian Pritz Thanks-to: Cédric Girard Signed-off-by: Lukas Fleischer --- web/lib/aur.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/lib') diff --git a/web/lib/aur.inc.php b/web/lib/aur.inc.php index 4c2cc559..73f8fd36 100644 --- a/web/lib/aur.inc.php +++ b/web/lib/aur.inc.php @@ -78,7 +78,7 @@ function check_sid() { # verify that an email address looks like it is legitimate # function valid_email($addy) { - return strpos($addy, '@'); + return (filter_var($addy, FILTER_VALIDATE_EMAIL) !== false); } # a new seed value for mt_srand() -- cgit v1.2.3-24-g4f1b