// ... what will the email address be out the @... ;-)
$PARTS = array();
- while (ereg("@", $test)) {
- $pos = strpos($test, "@");
+ while (ereg('@', $test)) {
+ $pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
// First check backwards
if (!in_array($check, $GLOBALS['valid_email_chars'])) {
// Char found so we end here
break;
- }
+ } // END - if
$idx--;
- }
+ } // END - while
if ($idx > 0) {
// Starting mark is found
$check2 = substr($test, 0, ($idx + 1));
$test = substr($test, ($idx + 1));
- }
+ } // END - if
// And now go forward...
$idx = 0;
while ($idx < strlen($test)) {
$check = substr($test, $idx, 1);
- if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != "@")) {
+ if ((!in_array($check, $GLOBALS['valid_email_chars'])) && ($check != '@')) {
// Char found so end here again
break;
- }
+ } // END - if
$idx++;
- }
+ } // END - while
if ($idx > 0) {
// Maybe this is the email address?
$check = substr($test, 0, $idx);
- }
+ } // END - if
// Now replace the email against anchor with mailto and pray...
- $PARTS[] = $check2."<a href=\"mailto:".$check."\">".$check."</a>";
+ $PARTS[] = $check2 . "<a href=\"" . generateEmailLink($check, 'user_data') . "\">" . $check . "</a>";
// Remove email from testing string (see above why...)
$test = substr($test, strlen($check));