You are here

function _recaptcha_mailhide_email_parts in reCAPTCHA 8

Same name and namespace in other branches
  1. 5.2 recaptcha/recaptchalib.php \_recaptcha_mailhide_email_parts()
  2. 6 recaptcha-php-1.11/recaptchalib.php \_recaptcha_mailhide_email_parts()
  3. 7 recaptcha-php-1.11/recaptchalib.php \_recaptcha_mailhide_email_parts()

gets the parts of the email to expose to the user. eg, given johndoe@example,com return ["john", "example.com"]. the email is then displayed as john...@example.com

1 call to _recaptcha_mailhide_email_parts()
recaptcha_mailhide_html in recaptcha-php-1.11/recaptchalib.php
Gets html to display an email address given a public an private key. to get a key, go to:

File

recaptcha-php-1.11/recaptchalib.php, line 248

Code

function _recaptcha_mailhide_email_parts($email) {
  $arr = preg_split("/@/", $email);
  if (strlen($arr[0]) <= 4) {
    $arr[0] = substr($arr[0], 0, 1);
  }
  else {
    if (strlen($arr[0]) <= 6) {
      $arr[0] = substr($arr[0], 0, 3);
    }
    else {
      $arr[0] = substr($arr[0], 0, 4);
    }
  }
  return $arr;
}