BBCodeEmailAddressValidator::check_email_address( $strEmailAddress )

Description

Source

File: bp-forums/admin/parser.php

function check_email_address($strEmailAddress) {
if (preg_match('/[\x00-\x1F\x7F-\xFF]/', $strEmailAddress)) {
return false;
}
$intAtSymbol = strrpos($strEmailAddress, '@');
if ($intAtSymbol === false) {
return false;
}
$arrEmailAddress[0] = substr($strEmailAddress, 0, $intAtSymbol);
$arrEmailAddress[1] = substr($strEmailAddress, $intAtSymbol + 1);
$arrTempAddress[0] = preg_replace('/"[^"]+"/'
,''
,$arrEmailAddress[0]);
$arrTempAddress[1] = $arrEmailAddress[1];
$strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];
if (strrpos($strTempAddress, '@') !== false) {
return false;
}
if (!$this->check_local_portion($arrEmailAddress[0])) {
return false;
}
if (!$this->check_domain_portion($arrEmailAddress[1])) {
return false;
}
return true;
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.