Prevents valide_email from returning non valid email addresses.
authorStéphane Jacob <sj@m4x.org>
Sun, 18 Oct 2009 22:19:04 +0000 (00:19 +0200)
committerStéphane Jacob <sj@m4x.org>
Sun, 18 Oct 2009 22:19:04 +0000 (00:19 +0200)
include/emails.inc.php

index d6e885f..cd7e0a0 100644 (file)
@@ -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);
     }