From 97664536b43c4c14dec70dc986e9ffab276941ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 19 Oct 2009 00:19:04 +0200 Subject: [PATCH] Prevents valide_email from returning non valid email addresses. --- include/emails.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/emails.inc.php b/include/emails.inc.php index d6e885f..cd7e0a0 100644 --- a/include/emails.inc.php +++ b/include/emails.inc.php @@ -55,8 +55,11 @@ function valide_email($str) $em = trim(rtrim($str)); $em = str_replace('<', '', $em); $em = str_replace('>', '', $em); + if (strpos($em, '@') === false) { + return; + } list($ident, $dom) = explode('@', $em); - if ($dom == $globals->mail->domain or $dom == $globals->mail->domain2) { + if ($dom == $globals->mail->domain || $dom == $globals->mail->domain2) { list($ident1) = explode('_', $ident); list($ident) = explode('+', $ident1); } -- 2.1.4