From: Stéphane Jacob Date: Sun, 18 Oct 2009 22:19:04 +0000 (+0200) Subject: Prevents valide_email from returning non valid email addresses. X-Git-Tag: xorg/0.10.2~47 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=97664536b43c4c14dec70dc986e9ffab276941ea;p=platal.git Prevents valide_email from returning non valid email addresses. --- 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); }