includes/email.php
changeset 48 fc9762553a3c
parent 21 663fcf528726
child 73 0a74676a2f2f
--- a/includes/email.php	Fri Jul 06 11:04:38 2007 -0400
+++ b/includes/email.php	Fri Jul 06 11:45:50 2007 -0400
@@ -595,7 +595,19 @@
    
   function mask_address($email)
   {
-    return str_replace('.', ' <DOT> ', str_replace('@', ' <AT> ', $email));
+    $at = array(' (AT) ', ' __AT__ ', ' *AT* ', ' [AT] ', ' <AT> ', ' <__AT__> ');
+    $dot = array(' (DOT) ', ' __DOT__ ', ' *DOT* ', ' [DOT] ', ' <DOT> ', ' <__DOT__> ');
+    while(strstr($email, '@'))
+    {
+      $my_at = $at[ array_rand($at) ];
+      $email = str_replace_once('@', $my_at, $email);
+    }
+    while(strstr($email, '.'))
+    {
+      $my_dot = $dot[ array_rand($dot) ];
+      $email = str_replace_once('.', $my_dot, $email);
+    }
+    return $email;
   }
   
   /**